kotelnik / plasma-applet-active-window-control

Plasma 5 applet for controlling currently active window.
GNU General Public License v2.0
120 stars 18 forks source link

Feature request: Control buttons should follow window decoration scheme #25

Closed ishovkun closed 6 years ago

ishovkun commented 8 years ago

It would be really awesome, if window control buttons followed the current decoration scheme. That would unify the look of the desktop, which the ultimate goal plasma developers are aiming at. But the widget is awesome anyway!

kotelnik commented 8 years ago

Thanks for feedback! I've already considered this and made some research and it seems this task is not that easy. Decoration buttons are made in qml (not svg images) and I didn't find any easy way to integrate them in the widget.

Let's keep this issue open. I'll investigate this again later.

sollidsnake commented 8 years ago

Instead of following the theme, there could be an option to set manually the icons of the controls. I've used a window control applet in the past that had that option.

kotelnik commented 8 years ago

That's a good idea. Since there are (for now) 4 icons (close, maximize, minimize, pin) with 2 or 4 variants (inactive-idle, inactive-hover, active-idle, active-hover). I now use 4 svgz files with 2 or 4 id-named groups. Do you think I should merge them to one file and then offer custom icons by setting this kind of svgz file?

Or what do you think is the right way to set custom icons?

sollidsnake commented 8 years ago

I believe you should use the formats that are already used instead of creating a new one with everything inside. The applet I used in the past offered a dialog box to choose a image for each of the icons. Maybe that would be easier so we don't have to mess with gimp/Inkscape to setup the icons we want.

But I'm not familiar with kde's icon system so I might be speaking nonsense here.

vmorenomarin commented 7 years ago

If I change the *.svgz files on icons/default directory, should change the icons? I have replaced the the *.svgz files and restarted plasmashell but still appears the default icons in the widget.

Any suggestion?

Svgz files changed, but stay default widget buttons

vmorenomarin commented 7 years ago

After restart kwin, the icons buttons does not appears, but the function of each buttom stay. i.e., if I clic on the position of button, it does his function.

What features must have the .sgvz files?

kotelnik commented 7 years ago

Hi! Sorry I'm answering this late. I will probably (for now) only allow to set custom svgz icons because it would otherwise require i bit more complexity to the code since every button has 2-4 states. I'll add the options soon :).

@vmorenomarin: now to your svgz - it is important to set proper ID to each "subicon" in your svgz file: active-idle active-hover inactive-idle (for 2-state buttons like maximize and pin) inactive-hover (for 2-state buttons like maximize and pin)

vmorenomarin commented 7 years ago

image

Here is with your suggestion to the *.sgvz files. Thanks a lot.

Theme decoration: Breezemite.

nerdius commented 7 years ago

@kotelnik

Decoration buttons are made in qml (not svg images)

Colour scheme is a different story, but Aurorae themes actually use SVGZ files. You can check ~/.local/share/aurorae/themes/ (or /usr/share/aurorae/themes/ for system-wide) directory if you have installed one. If you don't, you can install it via System SettingsApplication StyleWindow DecorationsGet New Decorations.

michaldybczak commented 7 years ago

Great! I'm happy that something is improving on that area! Been waiting forward to this.

A bit off topic, @vmorenomarin how did you make windows title to work that way with menu like on your screen? When I turn it on it always overlaps on menu so I have to turn it off. No options can fix that, maybe aside one (always fit), but that's causing plasmashell crashes so I can't use it.

nerdius commented 7 years ago

@michaldybczak

  1. Go to Active Window Control Settings.
  2. Enable the Buttons next to icon and text option from ButtonsBehaviour.
  3. Enable the Show next to icon and text option from Application Menu.
  4. Click OK to save the changes.
michaldybczak commented 7 years ago

@giogziro95, unfortunately, that doesn't work :(. All I get is the windows title/name behind buttons. Basically, anything in Application Menu doesn't change a thing, no matter what I set, I see no difference. The only option that did work was "always fit", but as I said, it causes plasmashell to crash and it's even hard to undo. It usually looks like that NO MATTER WHAT OPTIONS I CHOOSE when windows name/title is enabled. Actually, options simply doesn't have any visible effect or at least any effect that I could notice. Many options are unclear. For instance, what "elide" is? I couldn't find it in my dictionary :(.

Anyway, I feel that it goes too much off topic and I wouldn't want to hijack this thread. Maybe I start new one. Thanks

michaldybczak commented 7 years ago

Update: I uninstalled widget version from manjaro repo and installed the one from AUR and now the options work and title don't overlap with buttons. Still, impossible to set as I want (dynamically, so the buttons position would change according to windows name/title length). This is one of the most complicated widgets to set. I can play with options for an hour and still not get what I want and have no idea if that's even possible.

EDIT: I resolved all my issues in the topic: https://github.com/kotelnik/plasma-applet-active-window-control/issues/69

michaldybczak commented 7 years ago

Back to the topic. I wanted to replace default buttons from:

/usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/icons/default/

to breezmite buttons which are located in: ~/.local/share/aurorae/themes/Breezemite/

I noticed some challenges. First, your widget icons have only two circles, while breezmite icons have 5. Simple extension change from svg to svgz and copying files into widget's default directory does nothing. I deleted additional circle graphics to mimic your original file but that doesn't help. Still old icons are shown. Second, you said we needed to change proper id for each subicon. How do we do that in karbon? Or maybe there is some other program to do it? If we need to apply those IDs, then there is no actually no need to delete icons just apply proper IDs to some of them?

EDIT: I realized, there are layers in your svgz icons, like active-idle, active-hover, etc. I added the same layers to icons of aurorae file, moved graphics to proper layers and left those unecessary in layer1. Rebooted and... still no change. Where those default buttons come from if not from: /usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/icons/default/ I'm confused.

vmorenomarin commented 7 years ago

You must open the svg file as a text file with Kate or other editor. Then you localize the id tags and there you rename this id with the names associated to the buttons of the widget, i. e., active-idle, active-hover, inactive-idle and inactive-hover. Before that, the icons should be in the icons folder of the widget, with the names as show you on the next pic:

image

michaldybczak commented 7 years ago

What? In kwrite this looks like this: https://puu.sh/vEr0f/52f53c6616.png How can I make any head or tail of it?

Besides, I see you also figured out pin icon. Maybe it would be just qucker if you have posted your files, because I'm trying re-create what you did.

On gnome desktop, there is an extension, pixel saver and I could easily change icons in it by switching graphics. Here it's way more complicated :(

kotelnik commented 7 years ago

Hi! Finally I've made some progress. I don't know, how to properly use current decoration scheme. There is no simple way for built-in decorations (breeze, oxygen, plastik). Aurorae decorations are (as you already showed me) a bunch of svgs, so I've made a support for it. You can now fill in Settings -> Buttons: "Path to aurorae theme" textfield with absolute path to e.g. Breezemite theme (/home/your_username/.local/share/aurorae/themes/Breezemite/). And these will now show up in the widget.

Please let me know if there are some issues :).

vmorenomarin commented 7 years ago

I have tried: It's direct to apply a Aurorae theme. Excellent job.

michaldybczak commented 7 years ago

Aurorae theme support works fantastic! I'm happy. Now the plugin feels complete!

I might add that it would be nice to add some tip/info for users who have no idea what aurorae theme is (I didn't know its name till recently myself) and where located.

vmorenomarin commented 7 years ago

After a new session, the field "Path to aurorae theme" appears in blank. I must fill the field with path of aurorae theme, every new session.

michaldybczak commented 7 years ago

For me it works great since I set it up few days ago. No such issue.

nerdius commented 7 years ago

Doesn't seem to work in my case — the buttons aren't visible on the panel, although they are clickable and perform actions.

nerdius commented 7 years ago

The workaround that I used to use has also stopped working. The workaround was creating a custom icon set and replacing the default ones (after backing them up) with custom ones in /usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/icons/.

nerdius commented 7 years ago

So, Breezemite Aurorae theme works (even though the buttons are huge at full scale), but nothing else I tried does.

Also, here's the custom icon sets I've made: AWC-icons.zip.

kotelnik commented 7 years ago

it would be nice to add some tip/info for users who have no idea what aurorae theme is

Good point. But I intend to make a C++ plugin code for determining the decoration automatically. So this state is hopefully a temporary solution.

After a new session, the field "Path to aurorae theme" appears in blank

I cannot replicate that, sorry. New session means, you log out and log in?

@giogziro95: I've now added a combo box to settings where you can choose between svg and svgz images for aurorae theme. Try the svgz. It is what Arc theme uses.

vmorenomarin commented 7 years ago

I cannot replicate that, sorry. New session means, you log out and log in?

After a new boot. I dont know if occurs the same in log out and log in.

nerdius commented 7 years ago

@kotelnik Oh, great. Thank's for implementing that.

Now the only problem is the sizing, distances, and margins — I can't make them match to the Aurorae theme, that is, make the buttons 100% of the size of decoration buttons; furthermore, the anti-aliasing causes it to look worse than that. Also, distances and margins don't really match up.

Screenshot: AWC buttons

nerdius commented 7 years ago

After a new session, the field "Path to aurorae theme" appears in blank.

That's not the case on my desktop, but what happens is that it switches back to .svg from .svgz.

vmorenomarin commented 7 years ago

After a new session, the field "Path to aurorae theme" appears in blank. Solved in last commits. Thanks!!!