Commit fbb491b7 authored by Claes Sjöfors's avatar Claes Sjöfors

Ge graph aspect ratio fix for shrinking windows

parent 4a380d45
...@@ -200,6 +200,7 @@ void WGeGtk::activate_help(GtkWidget *w, gpointer data) ...@@ -200,6 +200,7 @@ void WGeGtk::activate_help(GtkWidget *w, gpointer data)
void WGeGtk::action_resize( GtkWidget *w, GtkAllocation *allocation, gpointer data) void WGeGtk::action_resize( GtkWidget *w, GtkAllocation *allocation, gpointer data)
{ {
WGe *ge = (WGe *)data; WGe *ge = (WGe *)data;
if ( ge->graph && !ge->scrollbar && !ge->navigator && ge->graph->grow) if ( ge->graph && !ge->scrollbar && !ge->navigator && ge->graph->grow)
ge->graph->set_default_layout(); ge->graph->set_default_layout();
...@@ -228,8 +229,8 @@ void WGeGtk::set_size( int width, int height) ...@@ -228,8 +229,8 @@ void WGeGtk::set_size( int width, int height)
gtk_window_resize( GTK_WINDOW(toplevel), default_width, default_height); gtk_window_resize( GTK_WINDOW(toplevel), default_width, default_height);
geometry.min_aspect = gdouble(default_width)/default_height; geometry.min_aspect = gdouble(default_width)/default_height * 0.95;
geometry.max_aspect = gdouble(default_width)/default_height * 1.02; geometry.max_aspect = gdouble(default_width)/default_height * 1.05;
gtk_window_set_geometry_hints( GTK_WINDOW(toplevel), GTK_WIDGET(toplevel), gtk_window_set_geometry_hints( GTK_WINDOW(toplevel), GTK_WIDGET(toplevel),
&geometry, GDK_HINT_ASPECT); &geometry, GDK_HINT_ASPECT);
...@@ -293,8 +294,8 @@ WGeGtk::WGeGtk( GtkWidget *wge_parent_wid, void *wge_parent_ctx, char *wge_name, ...@@ -293,8 +294,8 @@ WGeGtk::WGeGtk( GtkWidget *wge_parent_wid, void *wge_parent_ctx, char *wge_name,
CoWowGtk::SetWindowIcon( toplevel); CoWowGtk::SetWindowIcon( toplevel);
geometry.min_aspect = gdouble(window_width)/window_height; geometry.min_aspect = gdouble(window_width)/window_height * 0.95;
geometry.max_aspect = gdouble(window_width)/window_height * 1.02; geometry.max_aspect = gdouble(window_width)/window_height * 1.05;
gtk_window_set_geometry_hints( GTK_WINDOW(toplevel), GTK_WIDGET(toplevel), gtk_window_set_geometry_hints( GTK_WINDOW(toplevel), GTK_WIDGET(toplevel),
&geometry, GDK_HINT_ASPECT); &geometry, GDK_HINT_ASPECT);
......
...@@ -87,8 +87,8 @@ void XttGeGtk::set_size( int width, int height) ...@@ -87,8 +87,8 @@ void XttGeGtk::set_size( int width, int height)
// This condition is due to a bug in Reflection X 11.0.5... // This condition is due to a bug in Reflection X 11.0.5...
if ( !((XNav *)parent_ctx)->gbl.no_graph_ratio) { if ( !((XNav *)parent_ctx)->gbl.no_graph_ratio) {
// Note, equal min and max aspect will cause recursive resize on LXDE // Note, equal min and max aspect will cause recursive resize on LXDE
geometry.min_aspect = gdouble(default_width)/default_height; geometry.min_aspect = gdouble(default_width)/default_height * 0.95;
geometry.max_aspect = gdouble(default_width)/default_height * 1.02; geometry.max_aspect = gdouble(default_width)/default_height * 1.05;
gtk_window_set_geometry_hints( GTK_WINDOW(toplevel), GTK_WIDGET(toplevel), gtk_window_set_geometry_hints( GTK_WINDOW(toplevel), GTK_WIDGET(toplevel),
&geometry, GDK_HINT_ASPECT); &geometry, GDK_HINT_ASPECT);
} }
...@@ -329,10 +329,10 @@ XttGeGtk::XttGeGtk( GtkWidget *xg_parent_wid, void *xg_parent_ctx, const char *x ...@@ -329,10 +329,10 @@ XttGeGtk::XttGeGtk( GtkWidget *xg_parent_wid, void *xg_parent_ctx, const char *x
NULL); NULL);
g_free( titleutf8); g_free( titleutf8);
geometry.min_aspect = gdouble(window_width)/window_height; geometry.min_aspect = gdouble(window_width)/window_height * 0.95;
geometry.max_aspect = gdouble(window_width)/window_height * 1.02; geometry.max_aspect = gdouble(window_width)/window_height * 1.05;
gtk_window_set_geometry_hints( GTK_WINDOW(toplevel), GTK_WIDGET(toplevel), gtk_window_set_geometry_hints( GTK_WINDOW(toplevel), GTK_WIDGET(toplevel),
&geometry, GDK_HINT_ASPECT); &geometry, GDK_HINT_ASPECT);
if ( options & ge_mOptions_HideDecorations) if ( options & ge_mOptions_HideDecorations)
gtk_window_set_decorated( GTK_WINDOW(toplevel), FALSE); gtk_window_set_decorated( GTK_WINDOW(toplevel), FALSE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment