On Sunday, August 2, 2020 at 9:57:00 PM UTC-4 JD wrote:

> Cool! But it should be a core feature to be able to go back to the 
> previously selected state of the sidebar on save or cancel, atleast! 
>

I agree, I just don't/didn't know how yet.
 

>
> Just add this action before the hide-action on the edit button: 
> <$action-setfield $tiddler="$:/state/sidebar/save" text={{{ 
> [[$:/state/sidebar]is[tiddler]!text[]then{$:/state/sidebar!!text}else[yes]] 
> }}}/>
> Then on your cancel and save buttons, instead of always showing it, get 
> the value of the previous state/save: 
> <$action-setfield $tiddler="$:/state/sidebar" 
> text={{$:/state/sidebar/save}}/>
> Also, forgive me i'm just wondering, why the new svg's? Wouldn't it make 
> for a smaller plugin to just add a single css tiddler targetting your 
> buttons, then on  your buttons add a class that's unique you? 
>

I also didn't know CSS applied to svg's. But also I probably should create 
unique icons which don't use color as the sole way to differentiate them so 
as not to break people's theme's.
 

>
> Sample, add a stylesheet to your plugin with text: 
>
> .am-green svg { fill: green !important; }
>
> And to your edit button, for example, return the core edit button image 
> and just replace the class: 
>
> \whitespace trim
> <$button 
>   message="tm-edit-tiddler"
>   tooltip={{$:/language/Buttons/Edit/Hint}}
>   aria-label="Am Edit" 
>   class={{{ [<tv-config-toolbar-class>addsuffix[ am-green]] }}}
> >
> <$list filter="[<tv-config-toolbar-icons>match[yes]]">
> {{$:/core/images/edit-button}}
> </$list>
> <$list filter="[<tv-config-toolbar-text>match[yes]]">
> <span class="tc-btn-text">
> <$text text=" "/>
> <$text text="am edit"}/>
> </span>
> </$list>
> <$action-setfield $tiddler="$:/state/sidebar/save" text={{{ 
> [[$:/state/sidebar]is[tiddler]!text[]then{$:/state/sidebar!!text}else[yes]] 
> }}}/>
> <$action-setfield $tiddler="$:/state/sidebar" text="no"/>
> </$button>
>

Thanks for this - I wasn't sure if "if/then/else" was even a thing. I see 
it is.
 

>
> So there would be no need for identical images with just the color 
> difference? 
>
> Just a thought of course ^^,
>
> -jd
>
>
> On Mon, Aug 3, 2020, 06:57 amreus, wrote:
>
>> JD, Thanks again for your insight.
>>
>> You can see the prototype here: http://amreus.tiddlyspot.com
>>
>>
>> -477d-b42e-adf1e6d75124o%40googlegroups.com 
>>> <https://groups.google.com/d/msgid/tiddlywiki/8cac3f0d-b56b-477d-b42e-adf1e6d75124o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> -- 
>>
> You received this message because you are subscribed to a topic in the 
>> Google Groups "TiddlyWiki" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/tiddlywiki/OzlHFYjLPhk/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/196c22a3-5645-46d7-8507-c3216eb100f3o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tiddlywiki/196c22a3-5645-46d7-8507-c3216eb100f3o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2847344c-0c77-4c19-8117-ae01fac4c7c0n%40googlegroups.com.

Reply via email to