From 789069bb6b9ca1bd9da75e035b18728e83eb232c Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 5 May 2015 18:53:30 +0100 Subject: [PATCH] Add palette page control button --- core/images/palette.tid | 15 +++++++++++++++ core/language/en-GB/Buttons.multids | 2 ++ core/ui/PageControls/palette.tid | 20 ++++++++++++++++++++ core/wiki/paletteswitcher.tid | 2 ++ core/wiki/tags/PageControls.tid | 2 +- themes/tiddlywiki/vanilla/base.tid | 17 +++++++++++++++-- 6 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 core/images/palette.tid create mode 100644 core/ui/PageControls/palette.tid diff --git a/core/images/palette.tid b/core/images/palette.tid new file mode 100644 index 000000000..879f3927c --- /dev/null +++ b/core/images/palette.tid @@ -0,0 +1,15 @@ +title: $:/core/images/palette +tags: $:/tags/Image + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 9cd9c6fd5..2f3e88d29 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -54,6 +54,8 @@ NewTiddler/Caption: new tiddler NewTiddler/Hint: Create a new tiddler OpenWindow/Caption: open in new window OpenWindow/Hint: Open tiddler in new window +Palette/Caption: palette +Palette/Hint: Choose the colour palette Permalink/Caption: permalink Permalink/Hint: Set browser address bar to a direct link to this tiddler Permaview/Caption: permaview diff --git a/core/ui/PageControls/palette.tid b/core/ui/PageControls/palette.tid new file mode 100644 index 000000000..344f7432b --- /dev/null +++ b/core/ui/PageControls/palette.tid @@ -0,0 +1,20 @@ +title: $:/core/ui/Buttons/palette +tags: $:/tags/PageControls +caption: {{$:/core/images/palette}} {{$:/language/Buttons/Palette/Caption}} +description: {{$:/language/Buttons/Palette/Hint}} + + +<$button popup=<> tooltip={{$:/language/Buttons/Palette/Hint}} aria-label={{$:/language/Buttons/Palette/Caption}} class=<> selectedClass="tc-selected"> +<$list filter="[prefix[yes]]"> +{{$:/core/images/palette}} + +<$list filter="[prefix[yes]]"> +<$text text={{$:/language/Buttons/Palette/Caption}}/> + + + +<$reveal state=<> type="popup" position="below" animate="yes"> +
+{{$:/snippets/paletteswitcher}} +
+ \ No newline at end of file diff --git a/core/wiki/paletteswitcher.tid b/core/wiki/paletteswitcher.tid index 4ae97b391..f3f08713a 100644 --- a/core/wiki/paletteswitcher.tid +++ b/core/wiki/paletteswitcher.tid @@ -1,7 +1,9 @@ title: $:/snippets/paletteswitcher \define lingo-base() $:/language/ControlPanel/Palette/ +
<> <$view tiddler={{$:/palette}} field="name"/> +
<$linkcatcher to="$:/palette">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]sort[description]]">
<$link to={{!!title}}>
<$reveal state="$:/palette" type="match" text={{!!title}}>•<$reveal state="$:/palette" type="nomatch" text={{!!title}}>  ''<$view field="name" format="text"/>'' - <$view field="description" format="text"/>
<$transclude tiddler="$:/snippets/currpalettepreview"/>
diff --git a/core/wiki/tags/PageControls.tid b/core/wiki/tags/PageControls.tid index 7f7c8932d..bfea33aa2 100644 --- a/core/wiki/tags/PageControls.tid +++ b/core/wiki/tags/PageControls.tid @@ -1,2 +1,2 @@ title: $:/tags/PageControls -list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]] +list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]] diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 5a282ed27..d1cab4142 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1104,6 +1104,19 @@ html body.tc-body.tc-single-tiddler-window { line-height: 1.4; } +.tc-drop-down .tc-prompt { + padding: 0 14px; +} + +.tc-drop-down .tc-chooser { + border: none; +} + +.tc-drop-down .tc-chooser .tc-swatches-horiz { + font-size: 0.4em; + padding-left: 1.2em; +} + .tc-drop-down .tc-file-input-wrapper { width: 100%; } @@ -1608,8 +1621,8 @@ a.tc-tiddlylink.tc-plugin-info:hover svg { .tc-swatch { width: 2em; height: 2em; - margin: 4px; - border: 1px solid #000; + margin: 0.4em; + border: 1px solid #888; } /*