33using System . Reflection ;
44using System . Diagnostics ;
55using System . Windows . Forms ;
6+ using System . Threading . Tasks ;
67//
78using static Glow . TSModules ;
89
910namespace Glow {
1011 public partial class GlowAbout : Form {
1112 public GlowAbout ( ) {
1213 InitializeComponent ( ) ;
14+ //
1315 typeof ( DataGridView ) . InvokeMember ( "DoubleBuffered" , BindingFlags . NonPublic | BindingFlags . Instance | BindingFlags . SetProperty , null , AboutTable , new object [ ] { true } ) ;
1416 //
1517 PanelHeader . Parent = ImageAbout ;
@@ -19,41 +21,47 @@ public GlowAbout(){
1921 AboutTable . Columns . Add ( "LangTranslator" , "Translator" ) ;
2022 AboutTable . Columns [ 0 ] . Width = ( int ) ( 110 * this . DeviceDpi / 96f ) ;
2123 AboutTable . AllowUserToResizeColumns = false ;
24+ foreach ( DataGridViewColumn columnPadding in AboutTable . Columns ) {
25+ int scaledPadding = ( int ) ( 3 * this . DeviceDpi / 96f ) ;
26+ columnPadding . DefaultCellStyle . Padding = new Padding ( scaledPadding , 0 , 0 , 0 ) ;
27+ }
2228 foreach ( DataGridViewColumn A_Column in AboutTable . Columns ) { A_Column . SortMode = DataGridViewColumnSortMode . NotSortable ; }
2329 //
2430 TSImageRenderer ( CloseAboutBtn , Properties . Resources . ts_close , 20 ) ;
2531 }
2632 // DRAGGING VARIABLES
2733 // ======================================================================================================
28- private bool About_formIsDragging = false ;
29- private Point About_formDraggingStartPoint = new Point ( 0 , 0 ) ;
34+ private bool formIsDragging = false ;
35+ private Point formDraggingStartPoint = new Point ( 0 , 0 ) ;
3036 // ABOUT LOAD
3137 // ======================================================================================================
32- private void GlowAbout_Load ( object sender , EventArgs e ) {
38+ private async void GlowAbout_Load ( object sender , EventArgs e ) {
3339 try {
3440 LabelDeveloper . Text = Application . CompanyName ;
3541 LabelSoftware . Text = Application . ProductName ;
3642 LabelVersion . Text = TS_VersionEngine . TS_SofwareVersion ( 1 , Program . ts_version_mode ) ;
3743 LabelCopyright . Text = TS_SoftwareCopyrightDate . ts_scd_preloader ;
38- //
39- foreach ( var available_lang_file in AvailableLanguages ) {
40- TSSettingsSave software_read_settings = new TSSettingsSave ( available_lang_file ) ;
41- string [ ] get_name = software_read_settings . TSReadSettings ( "Main" , "lang_name" ) . Split ( '/' ) ;
42- string get_lang_translator = software_read_settings . TSReadSettings ( "Main" , "translator" ) ;
43- AboutTable . Rows . Add ( get_name [ 0 ] . Trim ( ) , get_lang_translator . Trim ( ) ) ;
44- }
45- AboutTable . ClearSelection ( ) ;
4644 // GET PRELOAD SETTINGS
4745 About_preloader ( ) ;
46+ //
47+ await Task . Run ( ( ) => LoadLanguageConverterName ( ) ) ;
4848 } catch ( Exception ) { }
4949 }
50+ private void LoadLanguageConverterName ( ) {
51+ foreach ( var available_lang_file in AvailableLanguages ) {
52+ TSSettingsSave software_read_settings = new TSSettingsSave ( available_lang_file ) ;
53+ string [ ] get_name = software_read_settings . TSReadSettings ( "Main" , "lang_name" ) . Split ( '/' ) ;
54+ string get_lang_translator = software_read_settings . TSReadSettings ( "Main" , "translator" ) ;
55+ AboutTable . BeginInvoke ( ( Action ) ( ( ) => {
56+ AboutTable . Rows . Add ( get_name [ 0 ] . Trim ( ) , get_lang_translator . Trim ( ) ) ;
57+ } ) ) ;
58+ }
59+ AboutTable . BeginInvoke ( ( Action ) ( ( ) => AboutTable . ClearSelection ( ) ) ) ;
60+ }
5061 // DYNAMIC THEME VOID
5162 // ======================================================================================================
5263 public void About_preloader ( ) {
5364 try {
54- // COLOR SETTINGS
55- TSSetWindowTheme ( Handle , GlowMain . theme ) ;
56- //
5765 BackColor = TS_ThemeEngine . ColorMode ( GlowMain . theme , "TSBT_BGColor2" ) ;
5866 PanelTxt . BackColor = TS_ThemeEngine . ColorMode ( GlowMain . theme , "TSBT_BGColor2" ) ;
5967 //
@@ -110,39 +118,38 @@ public void About_preloader(){
110118 // ======================================================================================================
111119 private void About_WebsiteBtn_Click ( object sender , EventArgs e ) {
112120 try {
113- Process . Start ( new ProcessStartInfo ( TS_LinkSystem . website_link ) { UseShellExecute = true } ) ;
121+ Process . Start ( new ProcessStartInfo ( TS_LinkSystem . website_link ) { UseShellExecute = true } ) ;
114122 } catch ( Exception ) { }
115123 }
116124 // GITHUB LINK
117125 // ======================================================================================================
118126 private void About_GitHubBtn_Click ( object sender , EventArgs e ) {
119127 try {
120- Process . Start ( new ProcessStartInfo ( TS_LinkSystem . github_link ) { UseShellExecute = true } ) ;
128+ Process . Start ( new ProcessStartInfo ( TS_LinkSystem . github_link ) { UseShellExecute = true } ) ;
121129 } catch ( Exception ) { }
122130 }
123131 // BUY ME A COFFEE LINK
124132 // ======================================================================================================
125133 private void About_BmacBtn_Click ( object sender , EventArgs e ) {
126134 try {
127- Process . Start ( new ProcessStartInfo ( TS_LinkSystem . ts_bmac ) { UseShellExecute = true } ) ;
135+ Process . Start ( new ProcessStartInfo ( TS_LinkSystem . ts_bmac ) { UseShellExecute = true } ) ;
128136 } catch ( Exception ) { }
129137 }
130138 // FORM DRAGGING SYSTEM
131139 // ======================================================================================================
132140 private void PanelHeader_MouseDown ( object sender , MouseEventArgs e ) {
133141 if ( e . Button == MouseButtons . Left ) {
134- About_formIsDragging = true ;
135- About_formDraggingStartPoint = new Point ( e . X , e . Y ) ;
142+ formIsDragging = true ;
143+ formDraggingStartPoint = new Point ( e . X , e . Y ) ;
136144 }
137145 }
138146 private void PanelHeader_MouseMove ( object sender , MouseEventArgs e ) {
139- if ( About_formIsDragging )
140- {
147+ if ( formIsDragging ) {
141148 Point form_location = PointToScreen ( e . Location ) ;
142- this . Location = new Point ( form_location . X - About_formDraggingStartPoint . X , form_location . Y - About_formDraggingStartPoint . Y ) ;
149+ this . Location = new Point ( form_location . X - formDraggingStartPoint . X , form_location . Y - formDraggingStartPoint . Y ) ;
143150 }
144151 }
145- private void PanelHeader_MouseUp ( object sender , MouseEventArgs e ) { About_formIsDragging = false ; }
152+ private void PanelHeader_MouseUp ( object sender , MouseEventArgs e ) { formIsDragging = false ; }
146153 // CLOSE ABOUT
147154 // ======================================================================================================
148155 private void CloseAboutBtn_Click ( object sender , EventArgs e ) { Close ( ) ; }
0 commit comments