Ticket #399: window-res.patch
File window-res.patch, 2.6 KB (added by kwixbit, 14 years ago) |
---|
-
gtk/util.c
284 284 gtk_scrolled_window_set_policy( scroll, GTK_POLICY_NEVER, 285 285 GTK_POLICY_NEVER ); 286 286 287 /* restore window sizes */ 288 int mainWindowHeight; 289 int mainWindowWidth; 290 291 mainWindowHeight = pref_int_get( PREF_KEY_MAIN_WINDOW_HEIGHT ); 292 mainWindowWidth = pref_int_get( PREF_KEY_MAIN_WINDOW_WIDTH ); 293 287 294 gtk_widget_size_request( GTK_WIDGET( wind ), &req ); 288 295 req.height = MAX( req.height, 300 ); 289 296 height = MIN( req.height, gdk_screen_get_height( screen ) / 5 * 4 ); … … 293 300 req.width = MAX( req.width, 500 ); 294 301 width = MIN( req.width, gdk_screen_get_width( screen ) / 2 ); 295 302 296 gtk_window_set_default_size( wind, width, height);303 gtk_window_set_default_size( wind, mainWindowHeight, mainWindowWidth ); 297 304 gtk_scrolled_window_set_policy( scroll, hscroll, vscroll ); 298 305 } 299 306 -
gtk/tr-prefs.c
85 85 pref_flag_set_default ( PREF_KEY_START, TRUE ); 86 86 pref_flag_set_default ( PREF_KEY_TRASH_ORIGINAL, FALSE ); 87 87 88 pref_string_set_default ( PREF_KEY_MAIN_WINDOW_HEIGHT, "300" ); 89 pref_string_set_default ( PREF_KEY_MAIN_WINDOW_WIDTH, "500" ); 90 88 91 pref_save( NULL ); 89 92 } 90 93 -
gtk/tr-prefs.h
49 49 #define PREF_KEY_MAX_PEERS_GLOBAL "max-peers-global" 50 50 #define PREF_KEY_MAX_PEERS_PER_TORRENT "max-peers-per-torrent" 51 51 #define PREF_KEY_BLOCKLIST_ENABLED "blocklist-enabled" 52 #define PREF_KEY_MAIN_WINDOW_HEIGHT "main-window-height" 53 #define PREF_KEY_MAIN_WINDOW_WIDTH "main-window-width" 52 54 53 54 55 void tr_prefs_init_global( void ); 55 56 56 57 #endif -
gtk/main.c
656 656 657 657 gtk_widget_show_all(r); 658 658 659 /* get and save window sizes */ 660 int mainWindowHeight; 661 int mainWindowWidth; 662 gtk_window_get_size( GTK_WINDOW(c), &mainWindowHeight, &mainWindowWidth ); 663 664 pref_int_set( PREF_KEY_MAIN_WINDOW_HEIGHT, mainWindowHeight ); 665 pref_int_set( PREF_KEY_MAIN_WINDOW_WIDTH, mainWindowWidth ); 666 pref_save(NULL); 667 659 668 /* clear the UI */ 660 669 gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) ); 661 670