Git Product home page Git Product logo

material-decoration's Introduction

Demo

material-decoration

Material-ish window decoration theme for KWin.

Locally Integrated Menus

This hides the AppMenu icon button and draws the menu in the titlebar.

Make sure you add the AppMenu button in System Settings > Application Style > Window Decorations > Buttons Tab.

TODO/Bugs (Issue #1):

  • Open Submenu on Shortcut (eg: Alt+F)
  • Display mnemonics when holding Alt

Upstream LIM discussion in the KDE Bug report: https://bugs.kde.org/show_bug.cgi?id=375951#c27

Installation

Binary package

sudo zypper ar obs://home:trmdi trmdi
sudo zypper in -r trmdi material-decoration

Building from source

Build dependencies:

  • Ubuntu:
sudo apt build-dep breeze
sudo apt build-dep kwin

Download the source:

cd ~/Downloads
git clone https://github.com/Zren/material-decoration.git
cd material-decoration

Then compile the decoration, and install it:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install

Select Material in System Settings > Application Style > Window Decorations.

To test changes, restart kwin_x11 with:

QT_LOGGING_RULES="*=false;kdecoration.material=true" kstart5 -- kwin_x11 --replace

Update

On 2020 June 18, the kdecoration id was changed from zzag to zren. You will need to re-select Material in System Settings > Application Style > Window Decoration. KWin will fallback to Breeze if you forget to do this.

Building from source

First navigate to the source directory, and git pull recent changes.

cd ~/Downloads/material-decoration
git pull origin master --ff-only

Then re-run the install instructions.

material-decoration's People

Contributors

nicman23 avatar trmdi avatar zren avatar zzag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

material-decoration's Issues

Open Submenu on Shortcut

As mentioned in Issue #1.

  • Open Submenu on Shortcut.
    • SublimeText has mnemonics, and opens app submenus at the top left of the window (relative (0,0)). So I'll probably need to adjust the position during an aboutToOpen signal or something. Or update it's position during updateButtonGeometry.
    • The shortcut opens the LIM submenu instead of the Global Menu in Sublime Text, which is a good sign.
    • Decorations don't recieve KeyEvents afaik. So it's not possible to detect Alt pressed. I don't think it's possible to detect a menu shortcut either. Gtk menus open (in the wrong spot), but Qt menus don't at all.
  • Display mnemonics when holding Alt.

This requires changes upstream in KWin to implement.

problem with menus that are too long

I am not able to describe the problem clearly, so I prefer to send a video. The issue emerges only for long menues (higher than screen hight)

pippo-2020-12-26_11.30.41.mp4

uniform titlebar with toolbar in kvantum

Hi.
Excuse me for my bad English
I want to opacity and blurness of titlebar and kvantum toolbar be same.
what do I must to do?
when i dont use transparency every thing is good but when use transparency and use same value of transparency in kvantum and material titlebar, but titlebar and toolbat not become uniform.

LIM: Respect Menu Font Settings

Current behaviour:
Currently LIM uses the Window title font settings

Expected behaviour:
LIM should use the Menu font settings

Steps to Reproduce:
Open KDE “System Settings”
Under Appearance click on Fonts
Change the font settings for Menu and Window title
Click Apply

Screenshot_20210205_223433

Additional Information:
System OS: Solus Plasma
material-decoration: 65fe6f5
built & packaged solbuild package-material-decoration.yml

HiDPI scaling is not respected for menu icons and padding

I have a HiDPI display at 250% scaling.

Here is a screenshot of how the Material menu looks:
konsole_Material_menu

Here is a screenshot of how a normal menu looks:
konsole_normal_menu

As you can see, the menu's icon size and padding are too small when scaling is used.

Decoration (possibly) breaks gtk applications.

The headerbar height increases as the gtk theme attempts to inject material window buttons into gtk.

Result: scrambled window buttons and narrow elongated buttons in the CSD. (degree of breakage depends on the theme).

(sorry I don't have a screenshot, I observed this on my previous install and don't want to break my current one). Moreover, the breakage persisted even after switching back to breeze default. Just something to keep an eye on - I could be wrong and it could have been caused by something else.

Maybe if the decoration just followed the upstream breeze style, there would be less potential for bugs (and greater visual consistency throughout the system - material style looks foreign on KDE).

Option to move the window title position

Beautiful product ... I've been looking for a way to have the "extended" global menu the title bar for a long time ... but, if it were possible, it would be interesting and practical to add two options related to the window title:

  • the ability to move it near the window buttons (for example on the right, where I keep them, but also on the left);
  • the ability to hide it completely.

LIM autonomous?

Would it be possible to "separate" the LIM from the KWin decoration so that it also works with the other decorations and also with the Aurorae themes?

@mojtaba82's fork (captionmenufeature branch)

@mojtaba82: I fork this nice decoration. and add a branch named captionmenufeatcher and merge caption and menu like unity lim.
It work but I'm not professional in programming. I would be glad if you test it.
Thanks

Changes:

  • LeftRight margins, with seperate values for maximized state.
    • I would layout it this way in the config:

    Normal:
    Left Margin: 0px Right Margin: 0px
    Maximized:
    Left Margin: 0px Right Margin: 0px

    • However I wouldn't add the margin feature in the first place since it breaks fitt's law. Adding margins around the buttons means that the top left/right of the titlebar is no longer part of the button. I would add padding to the buttons instead. It seems like you take this into account with the "maximized margins" however I personally find the "shifting" in Firefox annoying when it goes maximized.
  • Caption is always left aligned.
    • Makes sense you needed to add that, I haven't implemented Breeze's caption alignment mentioned in Issue #23.
  • Hide caption when titlebar is hovered
    • You used a } else /* ... multiple lines of code ... */ if (!titleBarIsHovered()) { which is really hard to read...
    • You also used if (!false) {} else {} when it's much easier to read when reversing the if/else logic so it's if (true) {} else {}.
    • It's not animated, so I can't use it for Issue #16.

Note: I only read the code diff, I didn't actually compile and test it.

Ability to disable window move when dragging menu buttons

In Issue #2, @emvaized asked if we could disable the "window drag" option.

It will need to:

Unity Menu Bug

When using material-decoration with the upper menu activated in the unity3D engine window it does not allow me to access the menu options, this does not happen if I use another theme such as breeze with said menu or if I remove the top menu.

I'm sorry it doesn't return any log through the terminal and this is a attached screenshots:

Screenshot_20210407_234759
Screenshot_20210408_000016
Screenshot_20210408_000153

Close, maximize and minimize buttons are very small in gtk apps with CSDs since Plasma 5.20

In Plasma 5.20, close, maximize, and minimize buttons now try to use the same look as buttons in SSDs resulting in very small buttons when your window decorations are used. Is this an issue on your side or is there something wrong on the Plasma side?
This is a screenshot from Firefox with CSDs enabled:

Screenshot_20200918_083041

It looks the same in gtk3-demo. This issue was also reported on the KDE bug tracker: https://bugs.kde.org/show_bug.cgi?id=426670 Could you look into this?

Opera-style mouseover effects in GTK theme?

Hi,

Is it possible to get the nice red rectangle on mouseover of the close button that Opera has on Linux, for the GTK theme?

I would like Firefox to have the same window decoration style as Opera.

AUR Package

I would be nice to have an AUR package for ArchLinux and Manjaro

Rounded corners

Would it be feasible to add an option for rounded corners? Preferably as a number value to make the curves configurable.

[Request] Make the window buttons svg

it would be great to have an easy way to interchange window buttons and also to have the original as svgs to use in for example active window control plasmoid

[Bug] Menu overflow

It seems that there's already some sort of implementation for when the titlebar isn't long enough for the menu to be displayed, however the button available for the menu overflow is not clickable. See screenshot below for clearer explanation.

Screenshot_20200421_140800

Menus don't work propertly in R Studio

Clicking on something in the menu like "File" doesn't open the menu, but it gets a highlight as if it is open.
And secondly, while the menu is "open", Alt-tab doesn't work neither you can move windows by dragging them on the decoration.
R Studio has to be closed to regain Alt-tab and window moving capabilities.

[Request] Detection of window grabbing

Basically, somehow making the menu buttons behave as if they were not there when I click and drag, and so just move the window around.
I do not know if this is possible, as there may be issues with the window manager or something (I really do not know much about this), but it would certainly take it to the next level, to the point where I could see this system become the standard. It is just too space-efficient. I love it.


Thanks for the work you are doing here. I hope it brings many people in to work it all out.

LIM Issues

  • Format mnemonics
  • Figure out how to detect when decoration->windowId changes so I can update AppMenuModel->winId as KWin reuses the decorations I think. It will sometimes show the menu for Dolphin over top a SublimeText window.
  • Refactor to use QMenuBar or implement:
  • Filter empty menu items without a label (Gtk apps 1st item).
  • Re-enable drawing the caption, using a gradient when covered by the appmenu.
  • Fix all menu items disabled
    • 2020-03-28___13-11-31
    • SublimeText > Preferences > Theme > Press Esc to close
    • This probably rebuilds the menu. The QActions inside the KDecoration buttons were probably deleted?
  • Window does not get focused when menu is clicked (Issue #3)
    • Note this affect the AppIcon and default AppMenu buttons too.
  • Fix invisible hitbox over the first menu item that triggers the menu overflow button.

Features

  • Hide menu on model windows.

Make shadow configurable?

Personally, I feel like the current one is just a bit too large.

Also, this is a unrelated question, but if I wanted to make the hover effect on the close button circular, and always have a circle surrounding it even when it wasn't hovering, how could I do this?

Bold buttons in v7

v6:
old_c
v7:
new_c

Settings:
settings

With medium button size it looks okay, identical to v6, not bold.
Is large supposed to look like this from now on?

Port to breeze style?

The current decoration looks out of place on plasma and results in different window borders between qt and gtk csd.

Wouldn't it make more sense to port it to the breeze style, or is that style too complex?

Ability to hide window's title

First of all, thanks for such a great project!
It improves system's usability a lot, while looking truly awesome.

I have a small feature request however - would it be possible to add in future builds option to completely hide window's title?
I feel like I've never used it at all - for me app's icon in the corner is more than enough to identify currently running application, and title destroys overall minimalistic view (especially in browsers, when on some websites title may take up the whole width of panel)

Thanks!

How to make Material Decoration default option for a global theme?

So when I try to change the defaults of a defaults file inside look and theme folder of that theme and try to replace this part -

[kwinrc][org.kde.kdecoration2]
BorderSize=None
ButtonsOnLeft=
ButtonsOnRight=IAX
library=org.kde.kwin.aurorae
theme=__aurorae__svg__Qogir-dark-circle

to something like this

[kwinrc][org.kde.kdecoration2]
BorderSize=None
ButtonsOnLeft=
ButtonsOnRight=IAX
library=org.kde.kwin.aurorae
**theme=__aurorae__svg__Material**

It's not selecting the material decoration when I change the theme to the one above.

Any way to achieve it? thanks!!

Fix all menu items disabled

As mentioned in Issue #1.

2020-03-28___13-11-31

  • SublimeText > Preferences > Theme > Press Esc to close
  • This probably rebuilds the menu. The QActions inside the KDecoration buttons were probably deleted?

@nicman23 experiences something similar in virt-manager?

@nicman23: virt-manager with appmenu-gtk-module is non functional with lim. most entries are greyed out and i cannot switch from console to display. if you need a video or a log just tell what you want me to send you.

Delay on menu population

Hi,

I tried many of the menus around, global menu and appmenu-applet in the panel included and all of them – including this – have a really annoying delay in the menu creation.

This is especially a problem in Visual Studio Code. When I open the program the first thing I usually do is navigate to the last opened projects. I click File->Recently Opened->MyProject.

With all of the mentioned menus there seems to be a delay in the menu population and clicking on 'Recently Opened' does nothing if you do not wait long enough before clicking on 'File'.
If you wait a little longer what can happen is that when clicking on 'Recently Opened' the list of projects shows as a sub-menu, but clicking on one of the items again does nothing.

It seems that the click handlers are bound to their respective menu items too late...

Can anyone confirm this issue?

Support for disabling blur

This option should be available both per application and for all apps (in my case I only don't want blur on certain applications' titlebar)

Sliver of Active/Inactive Color Stuck In Titlebar With Borders

Screenshot von 2021-03-16 11 23 45

Currently, I cannot define a difference between active and inactive windows, which leads to confusing overlapping where it is difficult to say, where one application window ends and another starts.

Material decoration should simply take the colours defined in system configuration and everybody would be happier.

Support for resizing buttons

Could you please add support for resizing button size? I was able to manually edit it with vim as per issue yagomont#2 (although the line number was different) successfully. I'd still appreciate the gui being available though.

1px Colored Window Borders

Hi,
I love your decoration and would like to add a narrow border (1pixel ideally) colored as the accent color when the window is focused.
Something like windows10 does, as shown in this image

Screenshot (131)

with this it would be much easier to spot the currently focused window.

I tried hacking this feature in your code, reserving border space on titlebar creation and adding draw calls in the paint event, but I could not get it to work properly (settings window decorations page crashes on decoration preview load, so i must be doing something very wrong).

I'll keep experimenting on my own, but please consider adding this feature.
And thanks for creating this awesome decoration!

Option to adjust space between menu items

I understand some concessions have to be made in order to keep the appmenu module functional, but if #16 is implemented, it'd be nice to add an option to configure the space between menu items.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.