Commit 21815767 authored by Philipp Erhardt's avatar Philipp Erhardt
Browse files

Add config option to set the default layout

parent 76717e82
......@@ -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* ::
......
[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
......@@ -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);
......
......@@ -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
......
Supports Markdown
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