Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/1457a049bb9e77cd85fda95ce492a4d79f536f4a
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/1457a049bb9e77cd85fda95ce492a4d79f536f4a
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/1457a049bb9e77cd85fda95ce492a4d79f536f4a

The branch, master has been updated
       via  1457a049bb9e77cd85fda95ce492a4d79f536f4a (commit)
      from  ebb2a33b0b68104920abbfa2c447595d2c3a2010 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=1457a049bb9e77cd85fda95ce492a4d79f536f4a
commit 1457a049bb9e77cd85fda95ce492a4d79f536f4a
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Treeview: Add `treeview_font_size` to options.
    
    Default is 11pt, and RISC OS overrides to 12pt.

diff --git a/desktop/options.h b/desktop/options.h
index 2f36887..437d104 100644
--- a/desktop/options.h
+++ b/desktop/options.h
@@ -59,7 +59,10 @@ NSOPTION_STRING(http_proxy_auth_pass, NULL)
 /** Proxy omission list */
 NSOPTION_STRING(http_proxy_noproxy, "localhost")
 
-/** Default font size / 0.1pt. */
+/** Default treeview font size (unit: 0.1pt) */
+NSOPTION_INTEGER(treeview_font_size, 110)
+
+/** Default font size (unit: 0.1pt) */
 NSOPTION_INTEGER(font_size, 128)
 
 /** Minimum font size. */
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 5e4ceed..fa7fea0 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3962,11 +3962,7 @@ nserror treeview_init(void)
 
        LOG("Initialising treeview module");
 
-       /* TODO: Should we add an extra `treeview_font_size` option for
-        *       treeviews instead of reusing the html rendering default
-        *       font size?
-        */
-       font_pt_size = nsoption_int(font_size);
+       font_pt_size = nsoption_int(treeview_font_size);
        if (font_pt_size <= 0) {
                font_pt_size = 11 * 10;
        }
diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c
index 9d5f6bb..7e508a8 100644
--- a/frontends/riscos/gui.c
+++ b/frontends/riscos/gui.c
@@ -314,6 +314,12 @@ static nserror set_defaults(struct nsoption_s *defaults)
         */
        nsoption_set_uint(disc_cache_size, 0);
 
+       /* Override core default treeview font size with 12 pt.
+        * TODO: 12 is the normal desktop font size, but users might run
+        *       with something different.
+        */
+       nsoption_set_int(treeview_font_size, 12 * 10);
+
        /* set default system colours for riscos ui */
        set_colour_from_wimp(defaults, wimp_COLOUR_BLACK, 
NSOPTION_sys_colour_ActiveBorder, 0x00000000);
        set_colour_from_wimp(defaults, wimp_COLOUR_CREAM, 
NSOPTION_sys_colour_ActiveCaption, 0x00dddddd);
diff --git a/utils/nsoption.c b/utils/nsoption.c
index 92ecfc1..f92debb 100644
--- a/utils/nsoption.c
+++ b/utils/nsoption.c
@@ -144,6 +144,14 @@ static void nsoption_validate(struct nsoption_s *opts, 
struct nsoption_s *defs)
        int cloop;
        bool black = true;
 
+       if (opts[NSOPTION_treeview_font_size].value.i  < 50) {
+               opts[NSOPTION_treeview_font_size].value.i = 50;
+       }
+
+       if (opts[NSOPTION_treeview_font_size].value.i > 1000) {
+               opts[NSOPTION_treeview_font_size].value.i = 1000;
+       }
+
        if (opts[NSOPTION_font_size].value.i  < 50) {
                opts[NSOPTION_font_size].value.i = 50;
        }


-----------------------------------------------------------------------

Summary of changes:
 desktop/options.h      |    5 ++++-
 desktop/treeview.c     |    6 +-----
 frontends/riscos/gui.c |    6 ++++++
 utils/nsoption.c       |    8 ++++++++
 4 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/desktop/options.h b/desktop/options.h
index 2f36887..437d104 100644
--- a/desktop/options.h
+++ b/desktop/options.h
@@ -59,7 +59,10 @@ NSOPTION_STRING(http_proxy_auth_pass, NULL)
 /** Proxy omission list */
 NSOPTION_STRING(http_proxy_noproxy, "localhost")
 
-/** Default font size / 0.1pt. */
+/** Default treeview font size (unit: 0.1pt) */
+NSOPTION_INTEGER(treeview_font_size, 110)
+
+/** Default font size (unit: 0.1pt) */
 NSOPTION_INTEGER(font_size, 128)
 
 /** Minimum font size. */
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 5e4ceed..fa7fea0 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3962,11 +3962,7 @@ nserror treeview_init(void)
 
        LOG("Initialising treeview module");
 
-       /* TODO: Should we add an extra `treeview_font_size` option for
-        *       treeviews instead of reusing the html rendering default
-        *       font size?
-        */
-       font_pt_size = nsoption_int(font_size);
+       font_pt_size = nsoption_int(treeview_font_size);
        if (font_pt_size <= 0) {
                font_pt_size = 11 * 10;
        }
diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c
index 9d5f6bb..7e508a8 100644
--- a/frontends/riscos/gui.c
+++ b/frontends/riscos/gui.c
@@ -314,6 +314,12 @@ static nserror set_defaults(struct nsoption_s *defaults)
         */
        nsoption_set_uint(disc_cache_size, 0);
 
+       /* Override core default treeview font size with 12 pt.
+        * TODO: 12 is the normal desktop font size, but users might run
+        *       with something different.
+        */
+       nsoption_set_int(treeview_font_size, 12 * 10);
+
        /* set default system colours for riscos ui */
        set_colour_from_wimp(defaults, wimp_COLOUR_BLACK, 
NSOPTION_sys_colour_ActiveBorder, 0x00000000);
        set_colour_from_wimp(defaults, wimp_COLOUR_CREAM, 
NSOPTION_sys_colour_ActiveCaption, 0x00dddddd);
diff --git a/utils/nsoption.c b/utils/nsoption.c
index 92ecfc1..f92debb 100644
--- a/utils/nsoption.c
+++ b/utils/nsoption.c
@@ -144,6 +144,14 @@ static void nsoption_validate(struct nsoption_s *opts, 
struct nsoption_s *defs)
        int cloop;
        bool black = true;
 
+       if (opts[NSOPTION_treeview_font_size].value.i  < 50) {
+               opts[NSOPTION_treeview_font_size].value.i = 50;
+       }
+
+       if (opts[NSOPTION_treeview_font_size].value.i > 1000) {
+               opts[NSOPTION_treeview_font_size].value.i = 1000;
+       }
+
        if (opts[NSOPTION_font_size].value.i  < 50) {
                opts[NSOPTION_font_size].value.i = 50;
        }


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to