Skip to content

Commit f4548ec

Browse files
committed
commander: set panel width according to main windows width
When the width of the Geany (main) window >= 500, the panel tries a half of that size as the default width. Otherwise, it gets the same width as the Geany window.
1 parent a96cfa6 commit f4548ec

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: commander/src/commander-plugin.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -675,9 +675,16 @@ create_panel (void)
675675
GtkTreeViewColumn *col;
676676
GtkCellRenderer *cell;
677677

678+
int window_width;
679+
int window_height;
680+
gtk_window_get_size(GTK_WINDOW(geany_data->main_widgets->window), &window_width, &window_height);
681+
if (window_width >= 500) {
682+
window_width = window_width / 2;
683+
}
684+
678685
plugin_data.panel = g_object_new (GTK_TYPE_WINDOW,
679686
"decorated", FALSE,
680-
"default-width", 1000,
687+
"default-width", window_width,
681688
"default-height", 200,
682689
"transient-for", geany_data->main_widgets->window,
683690
"window-position", GTK_WIN_POS_CENTER_ON_PARENT,

0 commit comments

Comments
 (0)