JD,

I suppose its also what the icon is. I have hacked a few core svg's to make 
totally new images for buttons.

But the truth is wther my own or a core tiddler, if I use colour for an 
indicator and that is the only change, your method will often be the best.

Hey, You know in the online forum you can edit the post and remove the "}"?

https://groups.google.com/d/msg/tiddlywiki/OzlHFYjLPhk/g_LcnEoUAQAJ

Regards
TW Tones

On Monday, August 3, 2020 at 12:29:59 PM UTC+10, JD wrote:
>
> Hi Tony! Yeah I think it boils down to a preference on which method to 
> use? 
>
> For the third bullet, cloning the svg, I think it's unnecessary when the 
> intent is /just/ to change a color (of course when there are other changes 
> I don't see why not ^^, ). So as to make the plugin more compact, why not 
> just add a class to the custom button and retain the use of the core svg?
>
> The second bullet is a nice approach but will kinda break compatibility in 
> a very miniscule way I think. When the intent is to always mimic the look 
> of the core edit button with just the color change, it won't update when 
> for some reason down the line, the core edit svg is updated
>
> So again I think it comes down to personal preference because they're all 
> correct approaches! As you can tell I prefer fewer tids, which isn't a bad 
> thing but is somewhat(?) against the principle of tiddlers: even the 
> smallest should be ready to be reusable hehe. 
>
> Thanks for outlining the different approaches! 
>
> - jd
>
> On Mon, Aug 3, 2020, 10:06 TW Tones, <anthon...@gmail.com <javascript:>> 
> wrote:
>
>> JD,
>>
>> That is a nice idea,  But I think it complements the other approaches
>>
>>    - Change color on the fly (your suggestion)
>>       - Helps reduce size of code
>>    - Embed the actual SVG in your code with a fill=color
>>       - Reduces number of tiddlers and helps perhaps make a single 
>>       tiddler solution
>>       - Allows other variations
>>    - Clone an existing and set the fill=color and other settings
>>       - Allows whole tiddler to be replaced with another icon without 
>>       touching the code.
>>    
>> Regards
>> TW Tones
>>
>> On Monday, August 3, 2020 at 11:57:00 AM UTC+10, 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! 
>>>
>>> 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? 
>>>
>>> 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>
>>>
>>> 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, <harl...@gmail.com> 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 
>>>> tiddl...@googlegroups.com.
>>>> 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 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 
>> tiddl...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/f9ff984e-169a-4750-9df2-0e0b0a789a34o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tiddlywiki/f9ff984e-169a-4750-9df2-0e0b0a789a34o%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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/dc5e9d2d-2683-4eba-9b26-0d376f52157bo%40googlegroups.com.

Reply via email to