New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
commander: hidpi scaling? #1044
Comments
Currently it's hard-coded to a 500×200 default size, and if resized the new size doesn't survives a Geany restart. There's 3 things I could do:
First option seems easy enough, and see below for a test patch. Here's the patch for solution 1 (untested, as I don't have a HiDPI monitor at hand). Note that this requires a Geany GTK3 build with GTK >= 3.10 (fairly old by now) and you having set the scaling factor rather than just raised the DPI through the roof. diff --git a/commander/src/commander-plugin.c b/commander/src/commander-plugin.c
index 9f8d0718..a138ec41 100644
--- a/commander/src/commander-plugin.c
+++ b/commander/src/commander-plugin.c
@@ -654,11 +654,16 @@ create_panel (void)
GtkWidget *scroll;
GtkTreeViewColumn *col;
GtkCellRenderer *cell;
+ gint scale = 1;
+
+#if GTK_CHECK_VERSION (3, 10)
+ scale = gtk_widget_get_scale_factor (geany_data->main_widgets->window);
+#endif
plugin_data.panel = g_object_new (GTK_TYPE_WINDOW,
"decorated", FALSE,
- "default-width", 500,
- "default-height", 200,
+ "default-width", 500 * scale,
+ "default-height", 200 * scale,
"transient-for", geany_data->main_widgets->window,
"window-position", GTK_WIN_POS_CENTER_ON_PARENT,
"type-hint", GDK_WINDOW_TYPE_HINT_DIALOG, |
Sorry for the delay. I can confirm that this works perfectly 👍
thanks! |
hm actually though, there is a problem here: if I set setting both |
I recently started using a 4k setup, doubling my font dpi, and noticed that the commander popup is still the same size as with a lower resolution, meaning that it can only show 2 entries. Any chance this could be scaled a bit?
The text was updated successfully, but these errors were encountered: