aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/menu.cc22
-rw-r--r--src/ui.cc22
-rw-r--r--src/ui.hh4
3 files changed, 36 insertions, 12 deletions
diff --git a/src/menu.cc b/src/menu.cc
index 94ab7e37..43fc27ab 100644
--- a/src/menu.cc
+++ b/src/menu.cc
@@ -645,16 +645,26 @@ void a_Menu_tools_popup(BrowserWindow *bw, void *v_wid)
{
const Fl_Menu_Item *item;
Fl_Widget *wid = (Fl_Widget*)v_wid;
+ UI *ui = (UI*)bw->ui;
static Fl_Menu_Item pm[] = {
{"Use remote CSS", 0, Menu_remote_css_cb, 0, FL_MENU_TOGGLE,0,0,0,0},
{"Use embedded CSS", 0, Menu_embedded_css_cb, 0,
FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0},
- {"Load images", 0, Menu_imgload_toggle_cb, 0, FL_MENU_TOGGLE,0,0,0,0},
+ {"Load images", 0, Menu_imgload_toggle_cb, 0,
+ FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0},
+ {"Panel size", 0, 0, (void*)"Submenu1", FL_SUBMENU,0,0,0,0},
+ {"tiny", 0,0,(void*)P_tiny,FL_MENU_RADIO,0,0,0,0},
+ {"small", 0,0,(void*)P_small,FL_MENU_RADIO,0,0,0,0},
+ {"medium",0,0,(void*)P_medium,FL_MENU_RADIO,0,0,0,0},
+ {"large", 0,0,(void*)P_large,FL_MENU_RADIO|FL_MENU_DIVIDER,0,0,0,0},
+ {"small icons", 0,0,(void*)10,FL_MENU_TOGGLE,0,0,0,0},
{0,0,0,0,0,0,0,0,0}
};
popup_bw = bw;
+ int cur_panelsize = ui->get_panelsize();
+ int cur_smallicons = ui->get_smallicons();
if (prefs.load_stylesheets)
pm[0].set();
@@ -662,9 +672,15 @@ void a_Menu_tools_popup(BrowserWindow *bw, void *v_wid)
pm[1].set();
if (prefs.load_images)
pm[2].set();
+ pm[4+cur_panelsize].setonly();
+ cur_smallicons ? pm[8].set() : pm[8].clear();
item = pm->popup(wid->x(), wid->y() + wid->h());
- if (item)
- ((Fl_Widget *)item)->do_callback();
+ if (item) {
+ if (VOIDP2INT(item->user_data_) == 10)
+ ui->change_panel(cur_panelsize, !cur_smallicons);
+ else
+ ui->change_panel(VOIDP2INT(item->user_data_), cur_smallicons);
+ }
}
diff --git a/src/ui.cc b/src/ui.cc
index f6ad84cd..3defba8a 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -238,7 +238,7 @@ static void search_cb(Fl_Widget *wid, void *data)
} else if (b == FL_MIDDLE_MOUSE) {
((UI*)data)->color_change_cb_i();
} else if (b == FL_RIGHT_MOUSE) {
- ((UI*)data)->panel_cb_i();
+ ((UI*)data)->change_panel(-1,-1);
}
}
@@ -551,11 +551,6 @@ void UI::make_panel(int ww)
{
Fl_Widget *w;
- if (PanelSize > P_large) {
- PanelSize = P_tiny;
- Small_Icons = !Small_Icons;
- }
-
if (Small_Icons)
icons = &small_icons;
else
@@ -1015,7 +1010,7 @@ void UI::customize(int flags)
/*
* On-the-fly panel style change
*/
-void UI::panel_cb_i()
+void UI::change_panel(int new_size, int small_icons)
{
// Remove current panel's bars
init_sizes();
@@ -1027,10 +1022,21 @@ void UI::panel_cb_i()
Fl::delete_widget(NavBar);
MenuBar = LocBar = NavBar = NULL;
+ // Set panel and icons size
+ if (new_size < 0 || small_icons < 0) {
+ if (++PanelSize > P_large) {
+ PanelSize = P_tiny;
+ Small_Icons = !Small_Icons;
+ }
+ } else {
+ PanelSize = new_size;
+ Small_Icons = small_icons;
+ }
+
// make a new panel
- ++PanelSize;
make_panel(TopGroup->w());
customize(0);
+ a_UIcmd_set_buttons_sens(a_UIcmd_get_bw_by_widget(this));
// adjust Main's height
int main_h = h() - (mh+(LocBar?lh:0)+nh+(FindBarSpace?fh:0)+sh);
diff --git a/src/ui.hh b/src/ui.hh
index ebe6b9f3..b42b2ab6 100644
--- a/src/ui.hh
+++ b/src/ui.hh
@@ -168,6 +168,9 @@ public:
void paste_url();
void set_panelmode(UIPanelmode mode);
UIPanelmode get_panelmode();
+ int get_panelsize() { return PanelSize; }
+ int get_smallicons() { return Small_Icons; }
+ void change_panel(int new_size, int small_icons);
void findbar_toggle(bool add);
void fullscreen_toggle();
@@ -177,7 +180,6 @@ public:
void pointerOnLink(int flag) { PointerOnLink = flag; }
// Hooks to method callbacks
- void panel_cb_i();
void color_change_cb_i();
void toggle_cb_i();
void panelmode_cb_i();