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

Implement stylesheet config option

Thanks to thorsten!
parent 35660a00
...@@ -181,6 +181,21 @@ VARIABLES ...@@ -181,6 +181,21 @@ VARIABLES
katarakt instance, then the other katarakt window is activated instead. katarakt instance, then the other katarakt window is activated instead.
'string' *icon_theme* :: 'string' *icon_theme* ::
The name of your icon theme. Fill in if auto detection fails. The name of your icon theme. Fill in if auto detection fails.
'string' *stylesheet* ::
See link:http://doc.qt.io/qt-4.8/stylesheet.html[]. It can be overridden
via Qt's *-stylesheet* command line option. The following example changes
the 'goto page' bar: +
+
----
stylesheet="
GotoLine {
margin: 0px;
padding: 4px;
border-top-right-radius: 6px;
border-top: 1px solid black;
border-right: 1px solid black;
}"
----
'int' *click_link_button* :: 'int' *click_link_button* ::
1: The mouse button used for clicking links. Buttons 1-5 are supported. 1: The mouse button used for clicking links. Buttons 1-5 are supported.
......
...@@ -18,6 +18,7 @@ thumbnail_size=32 ...@@ -18,6 +18,7 @@ thumbnail_size=32
rect_expansion=2 rect_expansion=2
quit_on_init_fail=false quit_on_init_fail=false
icon_theme= icon_theme=
stylesheet=
click_link_button=1 click_link_button=1
drag_view_button=2 drag_view_button=2
select_text_button=1 select_text_button=1
......
...@@ -42,6 +42,7 @@ void CFG::init_defaults() { ...@@ -42,6 +42,7 @@ void CFG::init_defaults() {
defaults["quit_on_init_fail"] = false; defaults["quit_on_init_fail"] = false;
defaults["single_instance_per_file"] = false; defaults["single_instance_per_file"] = false;
defaults["icon_theme"] = ""; defaults["icon_theme"] = "";
defaults["stylesheet"] = "";
// mouse buttons // mouse buttons
defaults["click_link_button"] = 1; defaults["click_link_button"] = 1;
......
...@@ -111,6 +111,11 @@ int main(int argc, char *argv[]) { ...@@ -111,6 +111,11 @@ int main(int argc, char *argv[]) {
} }
} }
// load stylesheet from config if no stylesheet was specified on the command line
if (app.styleSheet().isEmpty()) {
app.setStyleSheet(CFG::get_instance()->get_value("stylesheet").toString());
}
Viewer katarakt(file); Viewer katarakt(file);
if (!katarakt.is_valid()) { if (!katarakt.is_valid()) {
return 1; return 1;
......
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