Skip to content

Commit

Permalink
initial panel size as half-width
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnorantGuru committed Mar 27, 2014
1 parent 5c7fec1 commit 6ab491f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions src/main-window.c
Expand Up @@ -5231,9 +5231,21 @@ static gboolean idle_set_task_height( FMMainWindow* main_window )
{
GtkAllocation allocation;
int pos, taskh;

// restore height (in case window height changed)

gtk_widget_get_allocation( GTK_WIDGET( main_window ), &allocation );

// set new config panel sizes to half of window
if ( !xset_is( "panel_sliders" ) )
{
// this isn't perfect because panel half-width is set before user
// adjusts window size
XSet* set = xset_get( "panel_sliders" );
set->x = g_strdup_printf( "%d", allocation.width / 2 );
set->y = g_strdup_printf( "%d", allocation.width / 2 );
set->s = g_strdup_printf( "%d", allocation.height / 2 );
}

// restore height (in case window height changed)
taskh = xset_get_int( "task_show_manager", "x" ); // task height >=0.9.2
if ( taskh == 0 )
{
Expand Down
4 changes: 2 additions & 2 deletions src/settings.c
Expand Up @@ -1006,8 +1006,8 @@ void load_settings( char* config_dir )
if ( ver < 24 ) // < 0.9.4
{
// don't use panel_sliders-key - introduced in 0.9.2 as task man height
set = xset_get( "panel_sliders" );
if ( set->key != 0 )
set = xset_is( "panel_sliders" );
if ( set && set->key != 0 )
{
str = g_strdup_printf( "%d", set->key );
set->key = 0;
Expand Down

0 comments on commit 6ab491f

Please sign in to comment.