aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-09-13 18:22:27 +0000
committercorvid <corvid@lavabit.com>2011-09-13 18:22:27 +0000
commit91ba7012bd386f756df10bbffdbb8f4d8274dea5 (patch)
tree868cead2d246c199900f096865343313f687c1cf /src
parentfb39514b418cb293339d9f6028a496b2c4cca8da (diff)
UI theme preference
Diffstat (limited to 'src')
-rw-r--r--src/dillo.cc5
-rw-r--r--src/prefs.c3
-rw-r--r--src/prefs.h1
-rw-r--r--src/prefsparser.cc1
-rw-r--r--src/uicmd.cc4
5 files changed, 9 insertions, 5 deletions
diff --git a/src/dillo.cc b/src/dillo.cc
index 80053d02..b05cb16a 100644
--- a/src/dillo.cc
+++ b/src/dillo.cc
@@ -365,6 +365,8 @@ int main(int argc, char **argv)
// Sets WM_CLASS hint on X11
Fl_Window::default_xclass("dillo");
+ Fl::scheme(prefs.theme);
+
if (!prefs.show_tooltip) {
// turn off UI tooltips
Fl::option(Fl::OPTION_SHOW_TOOLTIPS, false);
@@ -393,9 +395,6 @@ int main(int argc, char **argv)
*/
((Fl_Widget *)bw->ui)->window()->make_current();
- /* Use FLTK_SCHEME environment variable, or X11 resource */
- Fl::scheme(NULL);
-
/* Proxy authentication */
if (prefs.http_proxyuser && !a_Http_proxy_auth()) {
const char *passwd = a_UIcmd_get_passwd(prefs.http_proxyuser);
diff --git a/src/prefs.c b/src/prefs.c
index 58ac5c32..234c9288 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -23,6 +23,7 @@
#define PREFS_SAVE_DIR "/tmp/"
#define PREFS_HTTP_REFERER "host"
#define PREFS_HTTP_USER_AGENT "Dillo/" VERSION
+#define PREFS_THEME "none"
/*-----------------------------------------------------------------------------
* Global Data
@@ -98,6 +99,7 @@ void a_Prefs_init(void)
prefs.show_url = TRUE;
prefs.small_icons = FALSE;
prefs.start_page = a_Url_new(PREFS_START_PAGE, NULL);
+ prefs.theme = dStrdup(PREFS_THEME);
prefs.w3c_plus_heuristics = TRUE;
}
@@ -126,4 +128,5 @@ void a_Prefs_freeall(void)
dFree(dList_nth_data(prefs.search_urls, i));
dList_free(prefs.search_urls);
a_Url_free(prefs.start_page);
+ dFree(prefs.theme);
}
diff --git a/src/prefs.h b/src/prefs.h
index e81bda18..0dd9ea81 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -49,6 +49,7 @@ struct _DilloPrefs {
int32_t bg_color;
bool_t contrast_visited_color;
bool_t show_tooltip;
+ char *theme;
int panel_size;
bool_t small_icons;
bool_t limit_text_width;
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index 4ebb39df..8a452387 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -107,6 +107,7 @@ int PrefsParser::parseOption(char *name, char *value)
{ "show_url", &prefs.show_url, PREFS_BOOL },
{ "small_icons", &prefs.small_icons, PREFS_BOOL },
{ "start_page", &prefs.start_page, PREFS_URL },
+ { "theme", &prefs.theme, PREFS_STRING },
{ "w3c_plus_heuristics", &prefs.w3c_plus_heuristics, PREFS_BOOL }
};
diff --git a/src/uicmd.cc b/src/uicmd.cc
index 715dcbe2..c97b4ba9 100644
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -123,7 +123,7 @@ public:
/* control buttons go inside a group */
Control = new Fl_Group(ww-ctl_w,0,ctl_w,ctab_h);
CloseBtn = new CustLightButton(ww-ctl_w+2,0,btn_w,ctab_h, "X");
- CloseBtn->box(FL_PLASTIC_ROUND_UP_BOX);
+ CloseBtn->box(FL_ROUND_UP_BOX);
CloseBtn->labelcolor(0x00641000);
CloseBtn->hl_color(FL_WHITE);
CloseBtn->clear_visible_focus();
@@ -252,7 +252,7 @@ UI *CustTabs::add_new_tab(UI *old_ui, int focus)
btn->labelsize(btn->labelsize()-2);
btn->copy_label(DEFAULT_TAB_LABEL);
btn->clear_visible_focus();
- btn->box(FL_PLASTIC_ROUND_UP_BOX);
+ btn->box(FL_ROUND_UP_BOX);
btn->color(focus ? tabcolor_active : tabcolor_inactive);
btn->ui(new_ui);
btn->callback(tab_btn_cb, this);