adwaita-qt icon indicating copy to clipboard operation
adwaita-qt copied to clipboard

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

Open fulalas opened this issue 2 years ago • 8 comments

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!

fulalas avatar Apr 17 '22 06:04 fulalas

Is this https://github.com/FedoraQt/adwaita-qt/issues/126 the same issue?

grulja avatar Apr 17 '22 17:04 grulja

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 avatar Apr 17 '22 22:04 fulalas

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 :)

fulalas avatar Apr 18 '22 00:04 fulalas

Can you open a merge request?

grulja avatar Apr 19 '22 10:04 grulja

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 :)

fulalas avatar Apr 19 '22 21:04 fulalas

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.

grulja avatar Apr 20 '22 05:04 grulja

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 :)

fulalas avatar Apr 20 '22 11:04 fulalas

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

polter-rnd avatar Dec 01 '22 07:12 polter-rnd