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
2801f10d
Commit
2801f10d
authored
Jan 03, 2017
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt virtual keyboard size adapted to screen size
parent
bed7fb61
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
2 deletions
+24
-2
xtt/lib/glow/src/glow_keyboardapi.cpp
xtt/lib/glow/src/glow_keyboardapi.cpp
+5
-0
xtt/lib/glow/src/glow_keyboardapi.h
xtt/lib/glow/src/glow_keyboardapi.h
+1
-0
xtt/lib/glow/src/glow_keyboardctx.cpp
xtt/lib/glow/src/glow_keyboardctx.cpp
+8
-0
xtt/lib/glow/src/glow_keyboardctx.h
xtt/lib/glow/src/glow_keyboardctx.h
+1
-0
xtt/lib/xtt/gtk/xtt_keyboard_gtk.cpp
xtt/lib/xtt/gtk/xtt_keyboard_gtk.cpp
+9
-2
No files found.
xtt/lib/glow/src/glow_keyboardapi.cpp
View file @
2801f10d
...
...
@@ -92,6 +92,11 @@ void keyboard_GetSize( keyboard_tCtx ctx, int *width, int *height)
ctx
->
get_size
(
width
,
height
);
}
void
keyboard_SetSize
(
keyboard_tCtx
ctx
,
int
width
,
int
height
)
{
ctx
->
set_size
(
width
,
height
);
}
void
keyboard_SetShift
(
keyboard_tCtx
ctx
,
int
shift
)
{
ctx
->
set_shift
(
shift
);
...
...
xtt/lib/glow/src/glow_keyboardapi.h
View file @
2801f10d
...
...
@@ -101,6 +101,7 @@ typedef KeyboardCtx *keyboard_tCtx;
void
keyboard_SetType
(
keyboard_tCtx
ctx
,
keyboard_eType
type
);
void
keyboard_SetDefaultConfig
(
keyboard_eKeymap
keymap
,
keyboard_eType
type
);
void
keyboard_GetSize
(
keyboard_tCtx
ctx
,
int
*
width
,
int
*
height
);
void
keyboard_SetSize
(
keyboard_tCtx
ctx
,
int
width
,
int
height
);
void
keyboard_SetShift
(
keyboard_tCtx
ctx
,
int
shift
);
/*@}*/
...
...
xtt/lib/glow/src/glow_keyboardctx.cpp
View file @
2801f10d
...
...
@@ -992,6 +992,14 @@ void KeyboardCtx::get_size( int *width, int *height)
*
height
=
int
((
y_high
-
y_low
)
*
mw
.
zoom_factor_y
);
}
void
KeyboardCtx
::
set_size
(
int
width
,
int
height
)
{
mw
.
zoom_factor_x
=
((
float
)
width
)
/
(
x_right
-
x_left
);
mw
.
zoom_factor_y
=
((
float
)
height
)
/
(
y_high
-
y_low
);
a
.
zoom
();
redraw
();
}
void
KeyboardCtx
::
set_shift
(
int
shift
)
{
if
(
shift
)
{
...
...
xtt/lib/glow/src/glow_keyboardctx.h
View file @
2801f10d
...
...
@@ -117,6 +117,7 @@ class KeyboardCtx : public GrowCtx {
*/
int
event_handler
(
glow_eEvent
event
,
int
x
,
int
y
,
int
w
,
int
h
);
void
get_size
(
int
*
width
,
int
*
height
);
void
set_size
(
int
width
,
int
height
);
void
set_shift
(
int
shift
);
keyboard_eType
type
;
...
...
xtt/lib/xtt/gtk/xtt_keyboard_gtk.cpp
View file @
2801f10d
...
...
@@ -118,11 +118,18 @@ XttKeyboardGtk::XttKeyboardGtk( void *xn_parent_ctx,
GtkWindow
*
window
=
GTK_WINDOW
(
toplevel
);
GdkScreen
*
screen
=
gtk_window_get_screen
(
window
);
// gtk_widget_set_size_request( toplevel, width, height);
gtk_window_resize
(
GTK_WINDOW
(
toplevel
),
width
,
height
);
int
screen_width
=
gdk_screen_get_width
(
screen
);
int
screen_height
=
gdk_screen_get_height
(
screen
);
if
(
width
>
screen_width
)
{
height
=
((
float
)
screen_width
)
*
0.9
/
width
*
height
;
width
=
screen_width
*
0.9
;
keyboard_SetSize
(
keyboardctx
,
width
,
height
);
}
gtk_window_resize
(
GTK_WINDOW
(
toplevel
),
width
,
height
);
int
x
=
screen_width
/
2
-
width
/
2
;
int
y
=
screen_height
-
height
;
...
...
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