Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to disable text fade when window is out of focus or resizing/moving? #170

Open
fulalas opened this issue Apr 17, 2022 · 8 comments

Comments

@fulalas
Copy link

fulalas commented Apr 17, 2022

I'm using 1.4.1 on LXQt and every time a window gets out of focus or is resized/moved its menu/list items get faded a bit. Is there a way to disable this? I'm a developer so changing code -- if necessary -- won't be a problem. :)

Thanks a lot for the hard work!

@grulja
Copy link
Collaborator

grulja commented Apr 17, 2022

Is this #126 the same issue?

@fulalas
Copy link
Author

fulalas commented Apr 17, 2022

It seems to be the same issue, but I don't get it. The change is already in 1.4.1 and I'm still seeing the issue.

@fulalas
Copy link
Author

fulalas commented Apr 18, 2022

OK, comparing 1.1.1 with 1.1.2 I managed to find the code responsible for part of the issue. In adwaitasyle.cpp you should change to this:

bool Style::drawItemViewItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const
{
    const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(option);
    if (!vopt) {
        return true;
    }

    QStyleOptionViewItem op(*vopt);

    QPalette palette = op.palette;
    if ((vopt->state & QStyle::State_Enabled) && !(vopt->state & QStyle::State_Active)) {
        palette.setColor(QPalette::Inactive, QPalette::Text, palette.color(QPalette::Active, QPalette::Text));
    }

    op.palette = palette;

    ParentStyleClass::drawControl(CE_ItemViewItem, &op, painter, widget);

    return true;
}

This will fix the grey out issue for out of focus/resizing/moving dialog for most elements. But menus, dropdowns, labels and background keep changing. I hope this can help somehow :)

@grulja
Copy link
Collaborator

grulja commented Apr 19, 2022

Can you open a merge request?

@fulalas
Copy link
Author

fulalas commented Apr 19, 2022

Well, I can but this is far from the final solution, don't you think?

The other day I found out that 1.0.0 (which is not available in this fork) doesn't mess with text/labels when out of focus/resizing/moving. This specific behavior started in 1.0.90. I tried to find what causes this change but the difference between these 2 versions is just too big so I gave up. It would be nice to also have that fix. We would be closer to proper fix this :)

@grulja
Copy link
Collaborator

grulja commented Apr 20, 2022

Well, I can but this is far from the final solution, don't you think?

I unfortunately don't have time to look into this at this moment so I don't know.

The other day I found out that 1.0.0 (which is not available in this fork) doesn't mess with text/labels when out of focus/resizing/moving. This specific behavior started in 1.0.90. I tried to find what causes this change but the difference between these 2 versions is just too big so I gave up. It would be nice to also have that fix. We would be closer to proper fix this :)

Isn't this expected behavior? I think on GNOME when a window gets out of focus, some parts of the UI gets faded. I know there was an issue in ListView/TreeView widgets which can get faded even when the window is focused, that's what I was trying to fix, but not probably what your bug is about.

@fulalas
Copy link
Author

fulalas commented Apr 20, 2022

You're right when you say GNOME does that, but it's subtle. Look:

Focused:
in

Out of focus:
out

Also, this behavior is related to GNOME, not Adwaita (which is the default GTK theme). If you take a look at Xfce using Adwaita, nothing changes when a given window is out of focus, except the title bar (which is not driven by Adwaita anyway).

Also, in your Adwaita port to Qt the window contents get faded when we move or resize it, which does not happen even in GNOME.

It's OK if you don't agree to change this behavior, really. If could only tell me what to change I'll be super happy :)

@polter-rnd
Copy link
Contributor

polter-rnd commented Dec 1, 2022

This bug is not related to adwaita-qt, it comes from qt5-qtwayland since commit e532733. That issue occur even on fusion style

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants