Changeset 8673


Ignore:
Timestamp:
Jun 11, 2009, 10:36:45 PM (13 years ago)
Author:
charles
Message:

(trunk gtk) #2201: transmission doesn't remember maximized state

Location:
trunk/gtk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/conf.c

    r8588 r8673  
    181181    tr_bencDictAddBool( d, PREF_KEY_OPTIONS_PROMPT, TRUE );
    182182
     183    tr_bencDictAddBool( d, PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED, FALSE );
    183184    tr_bencDictAddInt( d, PREF_KEY_MAIN_WINDOW_HEIGHT, 500 );
    184185    tr_bencDictAddInt( d, PREF_KEY_MAIN_WINDOW_WIDTH, 300 );
  • trunk/gtk/main.c

    r8671 r8673  
    248248                                 & GDK_WINDOW_STATE_MAXIMIZED );
    249249
     250    pref_int_set( PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED, isMaximized );
     251
    250252    if( !isMaximized )
    251253    {
     
    711713    /* clear the UI */
    712714    gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
     715
     716    /* ensure the window is in its previous position & size.
     717     * this seems to be necessary because changing the main window's
     718     * child seems to unset the size */
     719    gtk_window_resize( cbdata->wind, pref_int_get( PREF_KEY_MAIN_WINDOW_WIDTH ),
     720                                     pref_int_get( PREF_KEY_MAIN_WINDOW_HEIGHT ) );
     721    gtk_window_move( cbdata->wind, pref_int_get( PREF_KEY_MAIN_WINDOW_X ),
     722                                   pref_int_get( PREF_KEY_MAIN_WINDOW_Y ) );
    713723
    714724    /* shut down libT */
  • trunk/gtk/tr-prefs.h

    r8195 r8673  
    4646#define PREF_KEY_MAIN_WINDOW_X              "main-window-x"
    4747#define PREF_KEY_MAIN_WINDOW_Y              "main-window-y"
     48#define PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED   "main-window-is-maximized"
    4849
    4950#endif
  • trunk/gtk/tr-window.c

    r8419 r8673  
    833833                                 pref_int_get( PREF_KEY_MAIN_WINDOW_HEIGHT ) );
    834834    gtk_window_move( win, pref_int_get( PREF_KEY_MAIN_WINDOW_X ),
    835                      pref_int_get( PREF_KEY_MAIN_WINDOW_Y ) );
     835                          pref_int_get( PREF_KEY_MAIN_WINDOW_Y ) );
     836    if( pref_flag_get( PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED ) )
     837        gtk_window_maximize( win );
    836838    gtk_window_add_accel_group( win, gtk_ui_manager_get_accel_group( ui_mgr ) );
    837839
Note: See TracChangeset for help on using the changeset viewer.