psifidotos / applet-window-buttons

Plasma 5 applet in order to show window buttons in your panels
GNU General Public License v2.0
404 stars 55 forks source link

Smart Color Theme #111

Closed Sadi58 closed 3 years ago

Sadi58 commented 3 years ago

In the configuration window, Decoration shows such third-party themes as Arc and Arc Dark, Orchis and Orchis-dark, etc. If Breeze is selected, there appears another option below: Colors. When the panel where this Window Buttons applet sits is Latte Dock with Smart Color Theme, the color of the selected window buttons (either Breeze or others) doesn't change in keeping with the other items on the panel. I think it would be perfect if this could be achieved. Screenshot_2020-12-24-14-00-30

psifidotos commented 3 years ago

It does but for c++ decorations.

For aurorare decorations such as you are describing the situation is a bit strange how this could be achieved, it would break because aurorare themes use svg files for all their button situations so I don't think this is possible.

Sadi58 commented 3 years ago

In that case, could you suggest a workaround as to what we should do to fix this? For instance, creating a directory like "~/.local/share/aurorae/themes/OrchisMod" containing png images close.png, maximize.png, minimize.png, restore.png etc.?

psifidotos commented 3 years ago

If the aurorare theme was providing also Monochrome icons and was specifying this in its settings file then Latte could use those instead and provide the coloring you are describing.

psifidotos commented 3 years ago

Or even simpler if the aurorae theme has Monochrome buttons already then it could specify this in its settings and Latte would respect it.

Sadi58 commented 3 years ago
  1. I've created a duplicate of my current theme Orchis, and named it OrchisMod.
  2. I opened the eight *.svg files (alldesktops, close, decoration, keepabove, keepbelow, maximize, minimize, restore) in Krita, and saved them (monochrome with transparent background) as PNG.
  3. I opened the metadata.desktop file and changed the name Orchis to OrchisMod there, too.
  4. I renamed the file Orchisrc to OrchisModrc with the same contents as I could see nothing to change there. Selecting this new theme OrchisMod caused Latte-Dock to crash, but it was smart enough to automatically start again with the last working theme. Deleting the file decoration.png stopped prevented crash, but the buttons were invisible (Window Buttons applet configuration window Buttons field showing all black), although clicking in the right place worked. It seems, as a user with no theming skills, I need to learn to take one or two steps more to achieve the desired effect. Maybe I need to add one or two things in the settings file (copied below)?
    
    [General]
    ActiveFocusedTabColor=78,78,78
    ActiveTextColor=78,78,78
    ActiveTextShadowColor=255,255,255,255
    ActiveUnfocusedTabColor=120,120,120
    Animation=0
    InactiveFocusedTabColor=120,120,120
    InactiveTextColor=120,120,120
    InactiveTextShadowColor=255,255,255,255
    InactiveUnfocusedTabColor=120,120,120
    LeftButtons=
    RightButtons=IAX
    Shadow=true
    TextShadowOffsetX=1
    TextShadowOffsetY=1
    TitleAlignment=Center
    TitleVerticalAlignment=Center
    UseTextShadow=true

[Layout] BorderLeft=1 BorderRight=1 BorderBottom=12 TitleEdgeTop=8 TitleEdgeBottom=8 TitleEdgeLeft=16 TitleEdgeRight=16 TitleBorderLeft=50 TitleBorderRight=50 TitleHeight=16 ButtonWidth=22 ButtonHeight=22 ButtonSpacing=10 ButtonMarginTop=0 ButtonMarginLeft=0 ButtonMarginRight=0 ExplicitButtonSpacer=0 PaddingTop=36 PaddingBottom=96 PaddingRight=76 PaddingLeft=76 TitleEdgeTopMaximized=6 TitleEdgeBottomMaximized=6 TitleEdgeLeftMaximized=16 TitleEdgeRightMaximized=16

psifidotos commented 3 years ago
  1. Svgs are much better to support
  2. You don't have to create a new theme
  3. We can introduce a new option for rc file [General] group, that is called MonochromeIconsPrefix.

When MonochromeIconsPrefix=* it would mean that current icons are already capable to be painted properly monovhromatic

When MonochromeIconsPrefix=monochrome it would mean that there are separate images for example monochrome-close.svg that should be used instead when monochrome painting is needed.

That way the same aurorare themes can provide colored buttons and monochromatic at the same time. No separate theme is needed.

psifidotos commented 3 years ago

This is not supported yet. I just need to confirm that you agree in the approach and you can send me your theme as a test case.

What do you think?

Sadi58 commented 3 years ago

Thanks, it sounds great! I attach two popular themes, Arc and Orchis, although my current theme is Orchis. aurorae-themes-Orchis.zip aurorae-themes-Arc.zip

psifidotos commented 3 years ago

@Sadi58 feel free to to test it, examples are provided at https://github.com/psifidotos/applet-window-buttons/commit/991adbd6a178701f93be5b91e019ef6cce25cef4

Sadi58 commented 3 years ago

It worked! Thanks a million for this new year's gift!

psifidotos commented 3 years ago

;)