diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index 10f346e74..1d2ef1166 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -82,6 +82,11 @@ Settings/NavigationHistory/Caption: Navigation History Settings/NavigationHistory/Hint: Update browser history when navigating to a tiddler: Settings/NavigationHistory/No/Description: Do not update history Settings/NavigationHistory/Yes/Description: Update history +Settings/ToolbarButtonStyle/Caption: Toolbar Button Style +Settings/ToolbarButtonStyle/Hint: Choose the style for toolbar buttons: +Settings/ToolbarButtonStyle/Styles/Borderless: Borderless +Settings/ToolbarButtonStyle/Styles/Boxed: Boxed +Settings/ToolbarButtonStyle/Styles/Rounded: Rounded Settings/ToolbarButtons/Caption: Toolbar Buttons Settings/ToolbarButtons/Hint: Default toolbar button appearance: Settings/ToolbarButtons/Icons/Description: Include icon diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index cd6ff2045..c349fd4bb 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -95,11 +95,12 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) { fallbackFields = {text: ""}, newFields = {title: this.checkboxTitle}, hasChanged = false, - tagCheck = false; + tagCheck = false, + hasTag = tiddler && tiddler.hasTag(this.checkboxTag); if(this.checkboxTag && this.checkboxInvertTag === "yes") { - tagCheck = tiddler.hasTag(this.checkboxTag) === checked; + tagCheck = hasTag === checked; } else { - tagCheck = tiddler.hasTag(this.checkboxTag) !== checked; + tagCheck = hasTag !== checked; } // Set the tag if specified if(this.checkboxTag && (!tiddler || tagCheck)) { diff --git a/core/ui/ControlPanel/Settings/ButtonStyles/Borderless.tid b/core/ui/ControlPanel/Settings/ButtonStyles/Borderless.tid new file mode 100644 index 000000000..7ac368dec --- /dev/null +++ b/core/ui/ControlPanel/Settings/ButtonStyles/Borderless.tid @@ -0,0 +1,5 @@ +title: $:/core/buttonstyles/Borderless +tags: $:/tags/ToolbarButtonStyle +caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Borderless}} + +tc-btn-invisible \ No newline at end of file diff --git a/core/ui/ControlPanel/Settings/ButtonStyles/Boxed.tid b/core/ui/ControlPanel/Settings/ButtonStyles/Boxed.tid new file mode 100644 index 000000000..a615462ce --- /dev/null +++ b/core/ui/ControlPanel/Settings/ButtonStyles/Boxed.tid @@ -0,0 +1,5 @@ +title: $:/core/buttonstyles/Boxed +tags: $:/tags/ToolbarButtonStyle +caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Boxed}} + +tc-btn-boxed \ No newline at end of file diff --git a/core/ui/ControlPanel/Settings/ButtonStyles/Rounded.tid b/core/ui/ControlPanel/Settings/ButtonStyles/Rounded.tid new file mode 100644 index 000000000..e009ec544 --- /dev/null +++ b/core/ui/ControlPanel/Settings/ButtonStyles/Rounded.tid @@ -0,0 +1,5 @@ +title: $:/core/buttonstyles/Rounded +tags: $:/tags/ToolbarButtonStyle +caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Rounded}} + +tc-btn-rounded \ No newline at end of file diff --git a/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid b/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid new file mode 100644 index 000000000..5054b32f6 --- /dev/null +++ b/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid @@ -0,0 +1,12 @@ +title: $:/core/ui/ControlPanel/Settings/ToolbarButtonStyle +tags: $:/tags/ControlPanel/Settings +caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}} + +\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/ +<$link to="$:/config/Toolbar/ButtonClass"><> + +<$select tiddler="$:/config/Toolbar/ButtonClass"> +<$list filter="[all[shadows+tiddlers]tag[$:/tags/ToolbarButtonStyle]]"> + + + diff --git a/core/ui/PageControls/more-page-actions.tid b/core/ui/PageControls/more-page-actions.tid index 13964b880..11e149fc7 100644 --- a/core/ui/PageControls/more-page-actions.tid +++ b/core/ui/PageControls/more-page-actions.tid @@ -13,8 +13,7 @@ $:/config/PageControlButtons/Visibility/$(listItem)$ <$list filter="[prefix[yes]]"> <$text text={{$:/language/Buttons/More/Caption}}/> - -<$reveal state=<> type="popup" position="below" animate="yes"> +<$reveal state=<> type="popup" position="below" animate="yes">
diff --git a/core/ui/PageTemplate.tid b/core/ui/PageTemplate.tid index 974d93cf4..acd70ee83 100644 --- a/core/ui/PageTemplate.tid +++ b/core/ui/PageTemplate.tid @@ -10,7 +10,7 @@ tc-page-container tc-page-view-$(themeTitle)$ tc-language-$(languageTitle)$ <$set name="tv-config-toolbar-text" value={{$:/config/Toolbar/Text}}> -<$set name="tv-config-toolbar-class" value="tc-btn-invisible"> +<$set name="tv-config-toolbar-class" value={{$:/config/Toolbar/ButtonClass}}> <$set name="themeTitle" value={{$:/view}}> diff --git a/core/ui/ViewToolbar/more-tiddler-actions.tid b/core/ui/ViewToolbar/more-tiddler-actions.tid index 60b11d287..c20294250 100644 --- a/core/ui/ViewToolbar/more-tiddler-actions.tid +++ b/core/ui/ViewToolbar/more-tiddler-actions.tid @@ -14,15 +14,31 @@ $:/config/ViewToolbarButtons/Visibility/$(listItem)$ <$text text={{$:/language/Buttons/More/Caption}}/> <$reveal state=<> type="popup" position="below" animate="yes"> +
+ <$set name="tv-config-toolbar-icons" value="yes"> + <$set name="tv-config-toolbar-text" value="yes"> + +<$set name="tv-config-toolbar-class" value="tc-btn-invisible"> + <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" variable="listItem"> + <$reveal type="match" state=<> text="hide"> -<$transclude tiddler=<>/> + +<$transclude tiddler=<> mode="inline"/> + + + + + + +
+ \ No newline at end of file diff --git a/core/wiki/config/ToolbarButtonClass.tid b/core/wiki/config/ToolbarButtonClass.tid new file mode 100644 index 000000000..d3a755f1a --- /dev/null +++ b/core/wiki/config/ToolbarButtonClass.tid @@ -0,0 +1,3 @@ +title: $:/config/Toolbar/ButtonClass + +tc-btn-invisible \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.9.tid b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.9.tid index eb6bde7cc..c4b09cc04 100644 --- a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.9.tid +++ b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.9.tid @@ -25,6 +25,16 @@ To switch it on, visit ''Theme Tweaks'' in the $:/ControlPanel ''Appearance'' ta * Sidebar width: ** The width of the sidebar. Can be specified in pixels (eg ''350px''), a percentage (eg ''25%'') or other [[CSS unit|https://developer.mozilla.org/en/docs/Web/CSS/length]] +!! Toolbar Button Style Setting + +A new setting in $:/ControlPanel ''Settings'' tab allows the toolbar button style to be chosen from the following options: + +* <$button set="$:/config/Toolbar/ButtonClass" setTo="tc-btn-invisible">borderless the existing style +* <$button set="$:/config/Toolbar/ButtonClass" setTo="tc-btn-boxed">boxed, which adds a thin border box around the button +* <$button set="$:/config/Toolbar/ButtonClass" setTo="tc-btn-rounded">rounded, which rounds the button corners and inverts the button colours + +Plugins can add new style options. + !! New Tiddler Toolbar Button: "Open in new window" An experimental new tiddler toolbar button opens a single tiddler in a separate pop-up browser window. The tiddler will be dynamically updated just as in the main window. There are several uses: diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 5f5189619..266be34e2 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -332,6 +332,54 @@ button svg, button img { border: none; } +.tc-btn-boxed { + font-size: 0.6em; + padding: 0.2em; + margin: 1px; + background: none; + border: 1px solid <>; + border-radius: 0.25em; +} + +html body.tc-body .tc-btn-boxed svg { + font-size: 1.6666em; +} + +.tc-btn-boxed:hover { + background: <>; + color: <>; +} + +html body.tc-body .tc-btn-boxed:hover svg { + fill: <>; +} + +.tc-btn-rounded { + font-size: 0.5em; + line-height: 2; + padding: 0em 0.3em 0.2em 0.4em; + margin: 1px; + border: 1px solid <>; + background: <>; + color: <>; + border-radius: 2em; +} + +html body.tc-body .tc-btn-rounded svg { + font-size: 1.6666em; + fill: <>; +} + +.tc-btn-rounded:hover { + border: 1px solid <>; + background: <>; + color: <>; +} + +html body.tc-body .tc-btn-rounded:hover svg { + fill: <>; +} + .tc-btn-icon svg { height: 1em; width: 1em;