summaryrefslogtreecommitdiff
path: root/src/ui.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2012-12-30 03:38:42 +0000
committercorvid <corvid@lavabit.com>2012-12-30 03:38:42 +0000
commitaaab52c26db7ab85b263820947232d7eff8eebb3 (patch)
treeeeeaa33783c6ec53f18638c1c7669128f31fcf1c /src/ui.cc
parent08fcee0f972badaa2dc71ae5008fc5ae71dde1a3 (diff)
ui color fg/bg preferences
Recent mailing list: http://lists.auriga.wearlab.de/pipermail/dillo-dev/2012-December/009661.html The earlier thread begins with: http://lists.auriga.wearlab.de/pipermail/dillo-dev/2011-September/008890.html
Diffstat (limited to 'src/ui.cc')
-rw-r--r--src/ui.cc53
1 files changed, 21 insertions, 32 deletions
diff --git a/src/ui.cc b/src/ui.cc
index 2dab4954..e5f1f307 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -51,11 +51,11 @@ static struct iconset standard_icons = {
new Fl_Pixmap(search_xpm),
new Fl_Pixmap(help_xpm),
new Fl_Pixmap(left_xpm),
- new Fl_Pixmap(left_i_xpm),
+ NULL,
new Fl_Pixmap(right_xpm),
- new Fl_Pixmap(right_i_xpm),
+ NULL,
new Fl_Pixmap(stop_xpm),
- new Fl_Pixmap(stop_i_xpm),
+ NULL,
};
static struct iconset small_icons = {
@@ -70,11 +70,11 @@ static struct iconset small_icons = {
standard_icons.ImgSearch,
standard_icons.ImgHelp,
new Fl_Pixmap(left_s_xpm),
- new Fl_Pixmap(left_si_xpm),
+ NULL,
new Fl_Pixmap(right_s_xpm),
- new Fl_Pixmap(right_si_xpm),
+ NULL,
new Fl_Pixmap(stop_s_xpm),
- new Fl_Pixmap(stop_si_xpm),
+ NULL,
};
@@ -227,10 +227,6 @@ static void search_cb(Fl_Widget *wid, void *data)
if (b == FL_LEFT_MOUSE) {
a_UIcmd_search_dialog(a_UIcmd_get_bw_by_widget(wid));
- } else if (b == FL_MIDDLE_MOUSE) {
- ((UI*)data)->color_change_cb_i();
- } else if (b == FL_RIGHT_MOUSE) {
- // nothing ATM
}
}
@@ -410,6 +406,21 @@ CustButton *UI::make_button(const char *label, Fl_Image *img, Fl_Image *deimg,
*/
void UI::make_toolbar(int tw, int th)
{
+ if (!icons->ImgLeftIn) {
+ icons->ImgLeftIn = icons->ImgLeft->copy();
+ icons->ImgLeftIn->desaturate();
+ icons->ImgLeftIn->color_average(FL_GRAY, .5f);
+ }
+ if (!icons->ImgRightIn) {
+ icons->ImgRightIn = icons->ImgRight->copy();
+ icons->ImgRightIn->desaturate();
+ icons->ImgRightIn->color_average(FL_GRAY, .5f);
+ }
+ if (!icons->ImgStopIn) {
+ icons->ImgStopIn = icons->ImgStop->copy();
+ icons->ImgStopIn->desaturate();
+ icons->ImgStopIn->color_average(FL_GRAY, .5f);
+ }
Back = make_button("Back", icons->ImgLeft, icons->ImgLeftIn, UI_BACK, 1);
Forw = make_button("Forw", icons->ImgRight, icons->ImgRightIn, UI_FORW);
Home = make_button("Home", icons->ImgHome, NULL, UI_HOME);
@@ -446,7 +457,6 @@ void UI::make_location(int ww)
CustInput *i = new CustInput(p_xpos,0,ww-p_xpos-32,lh,0);
Location = i;
- i->color(CuteColor);
i->when(FL_WHEN_ENTER_KEY);
i->callback(location_cb, this);
i->set_tooltip("Location");
@@ -479,14 +489,12 @@ void UI::make_progress_bars(int wide, int thin_up)
IProg = new CustProgressBox(p_xpos,p_ypos,pw,bh);
IProg->labelsize(12);
IProg->box(thin_up ? FL_THIN_UP_BOX : FL_EMBOSSED_BOX);
- IProg->labelcolor(FL_GRAY_RAMP + 2);
IProg->update_label(wide ? "Images\n0 of 0" : "0 of 0");
p_xpos += pw;
// Page
PProg = new CustProgressBox(p_xpos,p_ypos,pw,bh);
PProg->labelsize(12);
PProg->box(thin_up ? FL_THIN_UP_BOX : FL_EMBOSSED_BOX);
- PProg->labelcolor(FL_GRAY_RAMP + 2);
PProg->update_label(wide ? "Page\n0.0 KB" : "0.0 KB");
}
@@ -646,14 +654,12 @@ UI::UI(int x, int y, int ui_w, int ui_h, const char* label, const UI *cur_ui) :
PanelTemporary = false;
if (cur_ui) {
PanelSize = cur_ui->PanelSize;
- CuteColor = cur_ui->CuteColor;
Small_Icons = cur_ui->Small_Icons;
Panelmode = cur_ui->Panelmode;
} else {
// Set some default values
PanelSize = prefs.panel_size;
Small_Icons = prefs.small_icons;
- CuteColor = 206;
Panelmode = (prefs.fullwindow_start) ? UI_HIDDEN : UI_NORMAL;
}
@@ -665,11 +671,9 @@ UI::UI(int x, int y, int ui_w, int ui_h, const char* label, const UI *cur_ui) :
Main = new Fl_Group(0,0,0,0,"Welcome..."); // size is set by rearrange()
Main->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
Main->box(FL_FLAT_BOX);
- Main->color(FL_GRAY_RAMP + 3);
Main->labelfont(FL_HELVETICA_BOLD_ITALIC);
Main->labelsize(36);
Main->labeltype(FL_SHADOW_LABEL);
- Main->labelcolor(FL_WHITE);
TopGroup->add(Main);
TopGroup->resizable(Main);
MainIdx = TopGroup->find(Main);
@@ -992,21 +996,6 @@ void UI::change_panel(int new_size, int small_icons)
}
/*
- * On-the-fly color style change
- */
-void UI::color_change_cb_i()
-{
- const int cols[] = {7,17,26,51,140,156,205,206,215,-1};
- static int ncolor = 0;
-
- ncolor = (cols[ncolor+1] < 0) ? 0 : ncolor + 1;
- CuteColor = cols[ncolor];
- MSG("Location color %d\n", CuteColor);
- Location->color(CuteColor);
- Location->redraw();
-}
-
-/*
* Set 'nw' as the main render area widget
*/
void UI::set_render_layout(Fl_Group *nw)