diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dillo.cc | 2 | ||||
-rw-r--r-- | src/nav.c | 2 | ||||
-rw-r--r-- | src/ui.cc | 23 | ||||
-rw-r--r-- | src/ui.hh | 2 | ||||
-rw-r--r-- | src/uicmd.cc | 5 | ||||
-rw-r--r-- | src/uicmd.hh | 2 |
6 files changed, 24 insertions, 12 deletions
diff --git a/src/dillo.cc b/src/dillo.cc index 2a4d7a77..bc2c0410 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -93,7 +93,7 @@ int main(int argc, char **argv) a_Cookies_init(); // Create a new UI/bw pair - BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0); + BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, NULL); if (argc == 2) { DilloUrl *url = Dillo_make_start_url(argv[1]); @@ -315,7 +315,7 @@ void a_Nav_push_nw(BrowserWindow *bw, const DilloUrl *url) BrowserWindow *newbw; a_UIcmd_get_wh(bw, &w, &h); - newbw = a_UIcmd_browser_window_new(w, h); + newbw = a_UIcmd_browser_window_new(w, h, bw->ui); a_Nav_push(newbw, url); } @@ -558,10 +558,21 @@ Group *UI::make_panel(int ww) /* * User Interface constructor */ -UI::UI(int win_w, int win_h, const char* label) : +UI::UI(int win_w, int win_h, const char* label, const UI *cur_ui) : Window(win_w, win_h, label) { int s_h = 20; + + if (cur_ui) { + PanelSize = cur_ui->PanelSize; + CuteColor = cur_ui->CuteColor; + Small_Icons = cur_ui->Small_Icons; + } else { + // Set some default values + //PanelSize = P_tiny, CuteColor = 26, Small_Icons = 0; + PanelSize = P_medium, CuteColor = 206, Small_Icons = 0; + } + resizable(this); clear_double_buffer(); begin(); @@ -571,10 +582,6 @@ UI::UI(int win_w, int win_h, const char* label) : // (the argument is set later via user_data()) TopGroup->callback(close_window_cb); - // Set some default values - //PanelSize = P_tiny, CuteColor = 26, Small_Icons = 0; - PanelSize = P_medium, CuteColor = 206, Small_Icons = 0; - // Control panel Panel = make_panel(win_w); @@ -643,6 +650,10 @@ UI::UI(int win_w, int win_h, const char* label) : customize(0); + if (cur_ui && cur_ui->Panel->w() == 0) { + fullscreen_cb_i(); + } + //show(); } @@ -669,7 +680,7 @@ int UI::handle(int event) a_UIcmd_open_url_dialog(user_data()); ret = 1; } else if (k == 'n') { - a_UIcmd_browser_window_new(w(), h()); + a_UIcmd_browser_window_new(w(), h(), this); ret = 1; } else if (k == 'o') { a_UIcmd_open_file(user_data()); @@ -62,7 +62,7 @@ class UI : public fltk::Window { public: - UI(int w, int h, const char* label = 0); + UI(int w, int h, const char* label = 0, const UI *cur_ui = NULL); ~UI() {} // TODO: implement destructor // To manage what events to catch and which to let pass diff --git a/src/uicmd.cc b/src/uicmd.cc index e6158ef9..27b44394 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -57,8 +57,9 @@ using namespace fltk; /* * Create a new UI and its associated BrowserWindow data structure. + * Use style from v_ui. If non-NULL it must be of type UI*. */ -BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh) +BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, const void *v_ui) { if (ww <= 0 || wh <= 0) { // Set default geometry from dillorc. @@ -67,7 +68,7 @@ BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh) } // Create and set the UI - UI *new_ui = new UI(ww, wh, "Dillo: UI"); + UI *new_ui = new UI(ww, wh, "Dillo: UI", (UI*) v_ui); new_ui->set_status("http://www.dillo.org/"); //new_ui->set_location("http://dillo.org/"); //new_ui->customize(12); diff --git a/src/uicmd.hh b/src/uicmd.hh index 85ed573f..70221615 100644 --- a/src/uicmd.hh +++ b/src/uicmd.hh @@ -8,7 +8,7 @@ extern "C" { #endif /* __cplusplus */ -BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh); +BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, const void *v_ui); void a_UIcmd_open_urlstr(void *vbw, const char *urlstr); void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url); void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url); |