Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
7f8a2062
Commit
7f8a2062
authored
Sep 12, 2015
by
Claes Sjöfors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge graph aspect ratio fix for shrinking windows
parent
fbb491b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
xtt/lib/xtt/gtk/xtt_ge_gtk.cpp
xtt/lib/xtt/gtk/xtt_ge_gtk.cpp
+11
-4
No files found.
xtt/lib/xtt/gtk/xtt_ge_gtk.cpp
View file @
7f8a2062
...
...
@@ -78,17 +78,20 @@ void XttGeGtk::set_size( int width, int height)
int
default_width
;
int
default_height
;
GdkGeometry
geometry
;
float
rd
=
0.05
;;
default_width
=
width
+
20
;
default_height
=
height
+
20
;
if
(
width
<
300
||
height
<
300
)
rd
=
0.2
;
gtk_window_resize
(
GTK_WINDOW
(
toplevel
),
default_width
,
default_height
);
// This condition is due to a bug in Reflection X 11.0.5...
if
(
!
((
XNav
*
)
parent_ctx
)
->
gbl
.
no_graph_ratio
)
{
// Note, equal min and max aspect will cause recursive resize on LXDE
geometry
.
min_aspect
=
gdouble
(
default_width
)
/
default_height
*
0.95
;
geometry
.
max_aspect
=
gdouble
(
default_width
)
/
default_height
*
1.05
;
geometry
.
min_aspect
=
gdouble
(
default_width
)
/
default_height
*
(
1.0
-
rd
)
;
geometry
.
max_aspect
=
gdouble
(
default_width
)
/
default_height
*
(
1.0
+
rd
)
;
gtk_window_set_geometry_hints
(
GTK_WINDOW
(
toplevel
),
GTK_WIDGET
(
toplevel
),
&
geometry
,
GDK_HINT_ASPECT
);
}
...
...
@@ -329,8 +332,12 @@ XttGeGtk::XttGeGtk( GtkWidget *xg_parent_wid, void *xg_parent_ctx, const char *x
NULL
);
g_free
(
titleutf8
);
geometry
.
min_aspect
=
gdouble
(
window_width
)
/
window_height
*
0.95
;
geometry
.
max_aspect
=
gdouble
(
window_width
)
/
window_height
*
1.05
;
float
rd
=
0.05
;
if
(
window_width
<
300
||
window_height
<
300
)
rd
=
0.2
;
printf
(
"w: %d h: %d rd: %5.3f
\n
"
,
window_width
,
window_height
,
rd
);
geometry
.
min_aspect
=
gdouble
(
window_width
)
/
window_height
*
(
1.0
-
rd
);
geometry
.
max_aspect
=
gdouble
(
window_width
)
/
window_height
*
(
1.0
+
rd
);
gtk_window_set_geometry_hints
(
GTK_WINDOW
(
toplevel
),
GTK_WIDGET
(
toplevel
),
&
geometry
,
GDK_HINT_ASPECT
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment