PapirusDevelopmentTeam / materia-kde

Materia KDE customization
https://git.io/materia-kde
GNU General Public License v3.0
627 stars 42 forks source link

Windows decorations. Tiny buttons size don't change titlebar size #110

Closed eugeneBecker closed 3 years ago

eugeneBecker commented 3 years ago

screenshot

varlesh commented 3 years ago

hm, it's very interested. I think Kwin locked minimal Height Title size with read from config rc-file By default it's 20px. https://github.com/KDE/kwin/blob/master/src/plugins/kdecorations/aurorae/src/lib/themeconfig.h#L264 But check Button Size Factor: https://github.com/KDE/kwin/blob/master/src/plugins/kdecorations/aurorae/src/qml/aurorae.qml#L152 And we have similar size on Buttons & Title - this minimal size... https://github.com/PapirusDevelopmentTeam/materia-kde/blob/master/aurorae/themes/Materia/Materiarc#L43 https://github.com/PapirusDevelopmentTeam/materia-kde/blob/master/aurorae/themes/Materia/Materiarc#L24

varlesh commented 3 years ago

if TitleHeight = 21px or more, for example 40px - minimal TitleHeight size will be 21px or 40px.

eugeneBecker commented 3 years ago

Do you have same issue? Maybe something with kwinrc?

varlesh commented 3 years ago

No, with Kwin all fine. 20px - it's minimal height size for aurorae title. When if we use 21px or more - this will be minimal size for title height. But we use 24px buttons & title too... it's more 20px and minimal size for title. I can set 20px for title height, but need test it. And this broken my mind )))

eugeneBecker commented 3 years ago

I set TitleHeight=18 look fine. Except for buttons. They are blurred

varlesh commented 3 years ago

Yes, it's will be blurred, because we use 24px buttons size - it's normal title size.

varlesh commented 3 years ago

aurorae not support different button sizes

varlesh commented 3 years ago

@eugeneBecker You can set extra small title & buttons - set:

TitleHeight=12
ButtonHeight=12
ButtonWidth=12

On settings set normal button size

varlesh commented 3 years ago

result image

eugeneBecker commented 3 years ago

Very small for 1080. But I will try to find the value I want

varlesh commented 3 years ago

original Materia GTK decoration use 32px Button size ))

eugeneBecker commented 3 years ago

I now. This takes more space. That's why i love KDE.

varlesh commented 3 years ago

image

varlesh commented 3 years ago

Very small for 1080. But I will try to find the value I want

It's impossible. Icons will be blurred

eugeneBecker commented 3 years ago

So. I find this values. Looks good TitleHeight=12 ButtonHeight=24 ButtonWidth=24

varlesh commented 3 years ago

It's only support minimal title size, but icons blurred

eugeneBecker commented 3 years ago

Heres screenshots 2 12px

varlesh commented 3 years ago

blurred: image

eugeneBecker commented 3 years ago

I don't understand how it works. But as I remember it was the same on previous versions. But thanks anyway. I don't think I could find these values :-)

varlesh commented 3 years ago

https://github.com/KDE/kwin/blob/master/src/plugins/kdecorations/aurorae/src/lib/auroraetheme.cpp#L473-L490

varlesh commented 3 years ago

i'm set 12px... but it\s solved only title size, buttons will be NON blurred only on Normal & Oversized

eugeneBecker commented 3 years ago

i'm set 12px... but it\s solved only title size, buttons will be NON blurred only on Normal & Oversized

On normal and Oversized buttons looks clear even with my values

varlesh commented 3 years ago

With previous too))

eugeneBecker commented 3 years ago

We need an expert from the KDE project to explain how it works)

varlesh commented 3 years ago

https://github.com/KDE/kwin/blob/master/src/plugins/kdecorations/aurorae/src/lib/auroraetheme.cpp#L473-L490 Normal 1% 24px = 24px Oversized 2% 24px = 48px Tiny - 0.80% 24px = 19,2px Large - 1.2% 24px = 28,8px VeryLarge - 1.4% 24px = 33,6px and etc... non round values will be blurred always

eugeneBecker commented 3 years ago

TitleHeight=18 ButtonHeight=24 ButtonWidth=24

This is not blurred so much, title size looks good

eugeneBecker commented 3 years ago

https://github.com/KDE/kwin/blob/master/src/plugins/kdecorations/aurorae/src/lib/auroraetheme.cpp#L473-L490 Normal 1% 24px = 24px Oversized 2% 24px = 48px Tiny - 0.80% 24px = 19,2px Large - 1.2% 24px = 28,8px VeryLarge - 1.4% 24px = 33,6px and etc... non round values will be blurred always

Yes. its true.

varlesh commented 3 years ago

it does not matter, because minimal title height size - it's button size = 24px. If button size will be 22px, Tiny Title Height will be 17,6px If button size will be 20px, Tiny Title Height will be 25px - it's round values, but wiil be blurred anyway, pixel grid will be broken.

12-24-48-72-96 = only this sizes will be have perfect pixel align

varlesh commented 3 years ago

if Tiny buttonSizeFactor will be - 0.5% we solved this problem and have 3 perfect pixel align

eugeneBecker commented 3 years ago

Actually, the blur is not that noticeable so much. The main thing we fixed title bar size

varlesh commented 3 years ago

@zzag Maybe better change step from 2 to 5? It's will be have more rounded values and perfect pixel align

qreal AuroraeTheme::buttonSizeFactor() const
{
    switch (d->buttonSize) {
    case KDecoration2::BorderSize::Tiny:
        return 0.5;
    case KDecoration2::BorderSize::Large:
        return 1.5;
    case KDecoration2::BorderSize::VeryLarge:
        return 2.0;
    case KDecoration2::BorderSize::Huge:
        return 2.5;
    case KDecoration2::BorderSize::VeryHuge:
        return 3.0;
    case KDecoration2::BorderSize::Oversized:
        return 3.5;
    case KDecoration2::BorderSize::Normal: // fall through
    default:
        return 1.0;
    }
}
eugeneBecker commented 3 years ago

But this is required kwin patch, right?

varlesh commented 3 years ago

yes

zzag commented 3 years ago

It's tricky. We definitely cannot do that in Plasma 5 time frame because that will potentially break other window decoration themes.

varlesh commented 3 years ago

Why it's broken other themes? Normal size not changed - it's 1%. But we have more rounded values with this:

eugeneBecker commented 3 years ago

What about icons size? Is changing icons size fix this issue?

varlesh commented 3 years ago

@eugeneBecker for normal and oversized only

eugeneBecker commented 3 years ago

If icons had 25 px? insted 24.

Normal 1% 25px = 25px Oversized 2% 25px = 50px Tiny - 0.80% 25px = 20px Large - 1.2% 25px = 30px VeryLarge - 1.4% 25px = 35px

varlesh commented 3 years ago

No, it's broken pixel grid

varlesh commented 3 years ago

pixel perfect for 25px=25-50-75-100 and etc

eugeneBecker commented 3 years ago

Got it. Anyway thanks for help. Today i've learned more)