Skip to content

Commit

Permalink
commander: set panel width according to main windows width
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
icy committed Dec 14, 2024
1 parent a96cfa6 commit f4548ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion commander/src/commander-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,16 @@ create_panel (void)
GtkTreeViewColumn *col;
GtkCellRenderer *cell;

int window_width;
int window_height;
gtk_window_get_size(GTK_WINDOW(geany_data->main_widgets->window), &window_width, &window_height);
if (window_width >= 500) {
window_width = window_width / 2;
}

plugin_data.panel = g_object_new (GTK_TYPE_WINDOW,
"decorated", FALSE,
"default-width", 1000,
"default-width", window_width,
"default-height", 200,
"transient-for", geany_data->main_widgets->window,
"window-position", GTK_WIN_POS_CENTER_ON_PARENT,
Expand Down

0 comments on commit f4548ec

Please sign in to comment.