changeset 72:fbda2a94d998

- Made "New browser window" inherit the panel style of its parent.
author jcid
date Sun, 16 Dec 2007 16:53:12 +0100
parents 44b5585aed17
children 0a8a112b8e48
files ChangeLog src/dillo.cc src/nav.c src/ui.cc src/ui.hh src/uicmd.cc src/uicmd.hh
diffstat 7 files changed, 29 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Dec 16 13:56:06 2007 +0100
+++ b/ChangeLog	Sun Dec 16 16:53:12 2007 +0100
@@ -72,14 +72,14 @@
  - Implemented "Load Images" in the page menu and cleaned up html.hh.
  - Added shortcuts: PgDn=Spc PgUp=b Back=BackSpace|, Forw=Shift+Backspace|.
  - Made a cleanup in cache's parse header code.
-   Patch: place, Jorge Arellano
+   Patch: place, Jorge Arellano Cid
 +- Fixed a va_list-related SEGFAULT on 64bit-arch in dStr_vsprintfa().
    Added const declarations in html parser.
    Patch: Vincent Thomasset
 +- Fixed void to int conversions for 64bit-arch.
-   Patch: Jorge Arellano, higuita
+   Patch: Jorge Arellano Cid, higuita
 +- Added a strndup() replacement in dw2
-   Patch: Alexander Becher, Johannes Hofmann, Jorge Arellano
+   Patch: Alexander Becher, Johannes Hofmann, Jorge Arellano Cid
 +- Fixed calcHashValue() to only return non-negative numbers (was SEGFAULT).
  - Improved scrolling performance on large pages by copying screen data
     instead of rendering.
@@ -87,6 +87,7 @@
  - Implemented drag-scrolling with the mouse's middle button.
  - Disabled double buffering (good for debugging redraws).
  - Switched dns.c from gethostbyname* to getaddrinfo (& removed libc5 code).
+ - Made "New browser window" inherit the panel style of its parent.
    Patches: Johannes Hofmann
 +- Improved FLTK library detection at configure time.
    Patch: Frank Gevaerts
@@ -154,7 +155,7 @@
    * Made the parser aware of buggy pages with multiple BODY and HTML elements.
    * Fixed a bug in MIME content/type detection.
    * Check HTTP Content-Type against real data (a security procedure).
-   Patches: Jorge Arellano
+   Patches: Jorge Arellano Cid
  - * Added a datauri dpi to handle "data:" URIs (RFC-2397).
    Patch: Jorge Arellano, Ben Wiley Sittler
  - * Moved the cookies management into a dpi server: cookies.dpi.
--- a/src/dillo.cc	Sun Dec 16 13:56:06 2007 +0100
+++ b/src/dillo.cc	Sun Dec 16 16:53:12 2007 +0100
@@ -93,7 +93,7 @@
    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]);
--- a/src/nav.c	Sun Dec 16 13:56:06 2007 +0100
+++ b/src/nav.c	Sun Dec 16 16:53:12 2007 +0100
@@ -315,7 +315,7 @@
    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);
 }
 
--- a/src/ui.cc	Sun Dec 16 13:56:06 2007 +0100
+++ b/src/ui.cc	Sun Dec 16 16:53:12 2007 +0100
@@ -558,10 +558,21 @@
 /*
  * 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 @@
      // (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 @@
 
    customize(0);
 
+   if (cur_ui && cur_ui->Panel->w() == 0) {
+      fullscreen_cb_i();
+   }
+
    //show();
 }
 
@@ -669,7 +680,7 @@
             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());
--- a/src/ui.hh	Sun Dec 16 13:56:06 2007 +0100
+++ b/src/ui.hh	Sun Dec 16 16:53:12 2007 +0100
@@ -62,7 +62,7 @@
 
 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
--- a/src/uicmd.cc	Sun Dec 16 13:56:06 2007 +0100
+++ b/src/uicmd.cc	Sun Dec 16 16:53:12 2007 +0100
@@ -57,8 +57,9 @@
 
 /*
  * 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 @@
    }
 
    // 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);
--- a/src/uicmd.hh	Sun Dec 16 13:56:06 2007 +0100
+++ b/src/uicmd.hh	Sun Dec 16 16:53:12 2007 +0100
@@ -8,7 +8,7 @@
 #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);