Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/22e1f141061fc067e2f470188bec08bf28b434e1
...commit
http://git.netsurf-browser.org/netsurf.git/commit/22e1f141061fc067e2f470188bec08bf28b434e1
...tree
http://git.netsurf-browser.org/netsurf.git/tree/22e1f141061fc067e2f470188bec08bf28b434e1
The branch, master has been updated
via 22e1f141061fc067e2f470188bec08bf28b434e1 (commit)
from 50f3460426f7ac3ca0b96f89fa80be69ba87bee6 (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=22e1f141061fc067e2f470188bec08bf28b434e1
commit 22e1f141061fc067e2f470188bec08bf28b434e1
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Amiga: Add "Enable CSS" item to the Browser menu
This allows for a quick toggle of CSS next to the similar JS option
Enable CSS has not yet been added to the full prefs GUI
diff --git a/frontends/amiga/gui_menu.c b/frontends/amiga/gui_menu.c
index b9c0dd9..dc1450f 100644
--- a/frontends/amiga/gui_menu.c
+++ b/frontends/amiga/gui_menu.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 Chris Young <[email protected]>
+ * Copyright 2017-2024 Chris Young <[email protected]>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -375,6 +375,18 @@ HOOKF(void, ami_menu_item_browser_enablejs, APTR, window,
struct IntuiMessage *)
ami_gui_menu_set_check_toggled();
}
+HOOKF(void, ami_menu_item_browser_enablecss, APTR, window, struct IntuiMessage
*)
+{
+ struct Menu *menustrip;
+ bool checked = false;
+
+ GetAttr(WINDOW_MenuStrip, (Object *)window, (ULONG *)&menustrip);
+ checked = ami_menu_get_selected(menustrip, msg);
+
+ nsoption_set_bool(author_level_css, checked);
+ ami_gui_menu_set_check_toggled();
+}
+
HOOKF(void, ami_menu_item_browser_scale_decrease, APTR, window, struct
IntuiMessage *)
{
struct gui_window_2 *gwin;
@@ -582,6 +594,10 @@ ULONG ami_gui_menu_number(int item)
case M_JS:
menu_num = FULLMENUNUM(2,9,0);
break;
+
+ case M_CSS:
+ menu_num = FULLMENUNUM(2,10,0);
+ break;
default:
NSLOG(netsurf, INFO,
@@ -690,6 +706,13 @@ void ami_gui_menu_update_checked(struct gui_window_2 *gwin)
if(ItemAddress(menustrip, ami_gui_menu_number(M_JS))->Flags &
CHECKED)
ItemAddress(menustrip,
ami_gui_menu_number(M_JS))->Flags ^= CHECKED;
}
+ if(nsoption_bool(author_level_css) == true) {
+ if((ItemAddress(menustrip, ami_gui_menu_number(M_CSS))->Flags &
CHECKED) == 0)
+ ItemAddress(menustrip,
ami_gui_menu_number(M_CSS))->Flags ^= CHECKED;
+ } else {
+ if(ItemAddress(menustrip, ami_gui_menu_number(M_CSS))->Flags &
CHECKED)
+ ItemAddress(menustrip,
ami_gui_menu_number(M_CSS))->Flags ^= CHECKED;
+ }
if(nsoption_bool(foreground_images) == true) {
if((ItemAddress(menustrip,
ami_gui_menu_number(M_IMGFORE))->Flags & CHECKED) == 0)
ItemAddress(menustrip,
ami_gui_menu_number(M_IMGFORE))->Flags ^= CHECKED;
@@ -919,6 +942,10 @@ static void ami_init_menulabs(struct ami_menu_data **md)
if(nsoption_bool(enable_javascript) == true)
js_flags |= CHECKED;
+ UWORD css_flags = CHECKIT | MENUTOGGLE;
+ if(nsoption_bool(author_level_css) == true)
+ css_flags |= CHECKED;
+
UWORD imgfore_flags = CHECKIT | MENUTOGGLE;
if(nsoption_bool(foreground_images) == true)
imgfore_flags |= CHECKED;
@@ -1007,6 +1034,8 @@ static void ami_init_menulabs(struct ami_menu_data **md)
ami_menu_item_browser_backimg, NULL, imgback_flags);
ami_menu_alloc_item(md, M_JS, NM_ITEM, "EnableJS", NULL, NULL,
ami_menu_item_browser_enablejs, NULL, js_flags);
+ ami_menu_alloc_item(md, M_CSS, NM_ITEM, "EnableCSS", NULL,
NULL,
+ ami_menu_item_browser_enablecss, NULL, css_flags);
ami_menu_alloc_item(md, M_BAR_B4, NM_ITEM, NM_BARLABEL, NULL,
NULL, NULL, NULL, 0);
ami_menu_alloc_item(md, M_REDRAW, NM_ITEM, "Redraw", NULL,
"TBImages:list_wand",
ami_menu_item_browser_redraw, NULL, 0);
diff --git a/frontends/amiga/gui_menu.h b/frontends/amiga/gui_menu.h
index ed72c24..ae36397 100644
--- a/frontends/amiga/gui_menu.h
+++ b/frontends/amiga/gui_menu.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2017 Chris Young <[email protected]>
+ * Copyright 2008-2024 Chris Young <[email protected]>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -78,13 +78,14 @@ enum {
M_IMGFORE,
M_IMGBACK,
M_JS,
+ M_CSS,
M_BAR_B4,
M_REDRAW,
/* Hotlist menu */
M_HOTLIST,
M_HLADD,
M_HLSHOW,
- M_BAR_H1, // 47
+ M_BAR_H1, // 48
AMI_MENU_HOTLIST, /* Where the hotlist entries start */
AMI_MENU_HOTLIST_MAX = AMI_MENU_HOTLIST + AMI_HOTLIST_ITEMS,
/* Settings menu */
diff --git a/resources/FatMessages b/resources/FatMessages
index 093d504..0c8ff71 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -8589,6 +8589,13 @@ it.all.DPI:DPI
nl.all.DPI:DPI
zh_CN.all.DPI:DPI(Dot Per Inch 每英寸点数)
+en.ami.EnableCSS:Enable CSS
+de.ami.EnableCSS:CSS benutzen
+fr.ami.EnableCSS:Activer le CSS
+it.ami.EnableCSS:Attiva CSS
+nl.ami.EnableCSS:CSS ingeschakeld
+zh_CN.ami.EnableCSS:启用 CSS
+
# Fonts tab
#
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/gui_menu.c | 31 ++++++++++++++++++++++++++++++-
frontends/amiga/gui_menu.h | 5 +++--
resources/FatMessages | 7 +++++++
3 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/frontends/amiga/gui_menu.c b/frontends/amiga/gui_menu.c
index b9c0dd9..dc1450f 100644
--- a/frontends/amiga/gui_menu.c
+++ b/frontends/amiga/gui_menu.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 Chris Young <[email protected]>
+ * Copyright 2017-2024 Chris Young <[email protected]>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -375,6 +375,18 @@ HOOKF(void, ami_menu_item_browser_enablejs, APTR, window,
struct IntuiMessage *)
ami_gui_menu_set_check_toggled();
}
+HOOKF(void, ami_menu_item_browser_enablecss, APTR, window, struct IntuiMessage
*)
+{
+ struct Menu *menustrip;
+ bool checked = false;
+
+ GetAttr(WINDOW_MenuStrip, (Object *)window, (ULONG *)&menustrip);
+ checked = ami_menu_get_selected(menustrip, msg);
+
+ nsoption_set_bool(author_level_css, checked);
+ ami_gui_menu_set_check_toggled();
+}
+
HOOKF(void, ami_menu_item_browser_scale_decrease, APTR, window, struct
IntuiMessage *)
{
struct gui_window_2 *gwin;
@@ -582,6 +594,10 @@ ULONG ami_gui_menu_number(int item)
case M_JS:
menu_num = FULLMENUNUM(2,9,0);
break;
+
+ case M_CSS:
+ menu_num = FULLMENUNUM(2,10,0);
+ break;
default:
NSLOG(netsurf, INFO,
@@ -690,6 +706,13 @@ void ami_gui_menu_update_checked(struct gui_window_2 *gwin)
if(ItemAddress(menustrip, ami_gui_menu_number(M_JS))->Flags &
CHECKED)
ItemAddress(menustrip,
ami_gui_menu_number(M_JS))->Flags ^= CHECKED;
}
+ if(nsoption_bool(author_level_css) == true) {
+ if((ItemAddress(menustrip, ami_gui_menu_number(M_CSS))->Flags &
CHECKED) == 0)
+ ItemAddress(menustrip,
ami_gui_menu_number(M_CSS))->Flags ^= CHECKED;
+ } else {
+ if(ItemAddress(menustrip, ami_gui_menu_number(M_CSS))->Flags &
CHECKED)
+ ItemAddress(menustrip,
ami_gui_menu_number(M_CSS))->Flags ^= CHECKED;
+ }
if(nsoption_bool(foreground_images) == true) {
if((ItemAddress(menustrip,
ami_gui_menu_number(M_IMGFORE))->Flags & CHECKED) == 0)
ItemAddress(menustrip,
ami_gui_menu_number(M_IMGFORE))->Flags ^= CHECKED;
@@ -919,6 +942,10 @@ static void ami_init_menulabs(struct ami_menu_data **md)
if(nsoption_bool(enable_javascript) == true)
js_flags |= CHECKED;
+ UWORD css_flags = CHECKIT | MENUTOGGLE;
+ if(nsoption_bool(author_level_css) == true)
+ css_flags |= CHECKED;
+
UWORD imgfore_flags = CHECKIT | MENUTOGGLE;
if(nsoption_bool(foreground_images) == true)
imgfore_flags |= CHECKED;
@@ -1007,6 +1034,8 @@ static void ami_init_menulabs(struct ami_menu_data **md)
ami_menu_item_browser_backimg, NULL, imgback_flags);
ami_menu_alloc_item(md, M_JS, NM_ITEM, "EnableJS", NULL, NULL,
ami_menu_item_browser_enablejs, NULL, js_flags);
+ ami_menu_alloc_item(md, M_CSS, NM_ITEM, "EnableCSS", NULL,
NULL,
+ ami_menu_item_browser_enablecss, NULL, css_flags);
ami_menu_alloc_item(md, M_BAR_B4, NM_ITEM, NM_BARLABEL, NULL,
NULL, NULL, NULL, 0);
ami_menu_alloc_item(md, M_REDRAW, NM_ITEM, "Redraw", NULL,
"TBImages:list_wand",
ami_menu_item_browser_redraw, NULL, 0);
diff --git a/frontends/amiga/gui_menu.h b/frontends/amiga/gui_menu.h
index ed72c24..ae36397 100644
--- a/frontends/amiga/gui_menu.h
+++ b/frontends/amiga/gui_menu.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2017 Chris Young <[email protected]>
+ * Copyright 2008-2024 Chris Young <[email protected]>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -78,13 +78,14 @@ enum {
M_IMGFORE,
M_IMGBACK,
M_JS,
+ M_CSS,
M_BAR_B4,
M_REDRAW,
/* Hotlist menu */
M_HOTLIST,
M_HLADD,
M_HLSHOW,
- M_BAR_H1, // 47
+ M_BAR_H1, // 48
AMI_MENU_HOTLIST, /* Where the hotlist entries start */
AMI_MENU_HOTLIST_MAX = AMI_MENU_HOTLIST + AMI_HOTLIST_ITEMS,
/* Settings menu */
diff --git a/resources/FatMessages b/resources/FatMessages
index 093d504..0c8ff71 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -8589,6 +8589,13 @@ it.all.DPI:DPI
nl.all.DPI:DPI
zh_CN.all.DPI:DPI(Dot Per Inch 每英寸点数)
+en.ami.EnableCSS:Enable CSS
+de.ami.EnableCSS:CSS benutzen
+fr.ami.EnableCSS:Activer le CSS
+it.ami.EnableCSS:Attiva CSS
+nl.ami.EnableCSS:CSS ingeschakeld
+zh_CN.ami.EnableCSS:启用 CSS
+
# Fonts tab
#
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]