Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philipp Erhardt
katarakt
Commits
21815767
Commit
21815767
authored
Apr 27, 2014
by
Philipp Erhardt
Browse files
Add config option to set the default layout
parent
76717e82
Changes
4
Hide whitespace changes
Inline
Side-by-side
doc/katarakt.txt
View file @
21815767
...
...
@@ -92,6 +92,8 @@ KEY BINDINGS
VARIABLES
---------
'string' *default_layout* ::
presentation: the layout on startup. Possible values: 'presentation', 'grid'
'int' *mouse_wheel_factor* ::
120: QT delta for turning the mouse wheel 1 click
'int' *smooth_scroll_delta* ::
...
...
share/katarakt.ini
View file @
21815767
[Settings]
default_layout
=
presentation
mouse_wheel_factor
=
120
smooth_scroll_delta
=
30
screen_scroll_factor
=
0.9
...
...
@@ -48,3 +49,4 @@ rotate_right=I
toggle_fullscreen
=
F
close_search
=
Esc
reload
=
R
open
=
O
src/canvas.cpp
View file @
21815767
...
...
@@ -25,10 +25,16 @@ Canvas::Canvas(Viewer *v, QWidget *parent) :
valid
(
true
)
{
setFocusPolicy
(
Qt
::
StrongFocus
);
layout
=
new
PresentationLayout
(
viewer
->
get_res
());
// load config options
CFG
*
config
=
CFG
::
get_instance
();
QString
default_layout
=
config
->
get_value
(
"default_layout"
).
toString
();
if
(
default_layout
==
"grid"
)
{
layout
=
new
GridLayout
(
viewer
->
get_res
());
}
else
{
// "presentation" and everything else
layout
=
new
PresentationLayout
(
viewer
->
get_res
());
}
// apply start option
layout
->
scroll_page
(
config
->
get_tmp_value
(
"start_page"
).
toInt
(),
false
);
...
...
src/config.cpp
View file @
21815767
...
...
@@ -8,6 +8,7 @@ CFG::CFG() :
settings
.
beginGroup
(
"Settings"
);
// canvas options
defaults
[
"default_layout"
]
=
"presentation"
;
defaults
[
"mouse_wheel_factor"
]
=
120
;
// (qt-)delta for turning the mouse wheel 1 click
defaults
[
"smooth_scroll_delta"
]
=
30
;
// pixel scroll offset
defaults
[
"screen_scroll_factor"
]
=
0.9
;
// creates overlap for scrolling 1 screen down, should be <= 1
...
...
Write
Preview
Supports
Markdown
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