plugins/overview: Make Window Filtering Optional
This commit makes window filtering optional by providing a checkbox in Desktop Effects > Overview > Overview Configuration KCM. The referenced bug report describes a bunch of the reasons why people wanted this option. BUG: 460710 FIXED-IN: 6.0
This commit is contained in:
parent
e67847d43f
commit
b0d8979178
5 changed files with 43 additions and 5 deletions
|
@ -65,7 +65,21 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_FilterWindows">
|
||||
<property name="text">
|
||||
<string>Search results include filtered windows:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="kcfg_FilterWindows">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="KShortcutsEditor" name="shortcutsEditor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
<entry name="IgnoreMinimized" type="bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="FilterWindows" type="bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="OrganizedGrid" type="bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
|
|
|
@ -168,6 +168,7 @@ void OverviewEffect::reconfigure(ReconfigureFlags)
|
|||
OverviewConfig::self()->read();
|
||||
setLayout(OverviewConfig::layoutMode());
|
||||
setAnimationDuration(animationTime(300));
|
||||
setFilterWindows(OverviewConfig::filterWindows());
|
||||
|
||||
for (const ElectricBorder &border : std::as_const(m_borderActivate)) {
|
||||
effects->unreserveElectricBorder(border, this);
|
||||
|
@ -197,6 +198,19 @@ void OverviewEffect::setAnimationDuration(int duration)
|
|||
}
|
||||
}
|
||||
|
||||
bool OverviewEffect::filterWindows() const
|
||||
{
|
||||
return m_filterWindows;
|
||||
}
|
||||
|
||||
void OverviewEffect::setFilterWindows(bool filterWindows)
|
||||
{
|
||||
if (m_filterWindows != filterWindows) {
|
||||
m_filterWindows = filterWindows;
|
||||
Q_EMIT filterWindowsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
qreal OverviewEffect::overviewPartialActivationFactor() const
|
||||
{
|
||||
return m_overviewState->partialActivationFactor();
|
||||
|
|
|
@ -18,6 +18,7 @@ class OverviewEffect : public QuickSceneEffect
|
|||
Q_PROPERTY(int animationDuration READ animationDuration NOTIFY animationDurationChanged)
|
||||
Q_PROPERTY(int layout READ layout NOTIFY layoutChanged)
|
||||
Q_PROPERTY(bool ignoreMinimized READ ignoreMinimized NOTIFY ignoreMinimizedChanged)
|
||||
Q_PROPERTY(bool filterWindows READ filterWindows NOTIFY filterWindowsChanged)
|
||||
Q_PROPERTY(bool organizedGrid READ organizedGrid NOTIFY organizedGridChanged)
|
||||
Q_PROPERTY(qreal overviewPartialActivationFactor READ overviewPartialActivationFactor NOTIFY overviewPartialActivationFactorChanged)
|
||||
// More efficient from a property binding pov rather than checking if partialActivationFactor is strictly between 0 and 1
|
||||
|
@ -39,6 +40,9 @@ public:
|
|||
bool ignoreMinimized() const;
|
||||
bool organizedGrid() const;
|
||||
|
||||
bool filterWindows() const;
|
||||
void setFilterWindows(bool filterWindows);
|
||||
|
||||
int animationDuration() const;
|
||||
void setAnimationDuration(int duration);
|
||||
|
||||
|
@ -67,6 +71,7 @@ Q_SIGNALS:
|
|||
void gridPartialActivationFactorChanged();
|
||||
void gridGestureInProgressChanged();
|
||||
void ignoreMinimizedChanged();
|
||||
void filterWindowsChanged();
|
||||
void organizedGridChanged();
|
||||
void desktopOffsetChanged();
|
||||
void searchTextChanged();
|
||||
|
@ -93,6 +98,7 @@ private:
|
|||
QList<ElectricBorder> m_borderActivate;
|
||||
QString m_searchText;
|
||||
QPointF m_desktopOffset;
|
||||
bool m_filterWindows = true;
|
||||
int m_animationDuration = 400;
|
||||
int m_layout = 1;
|
||||
};
|
||||
|
|
|
@ -262,7 +262,7 @@ FocusScope {
|
|||
effect.searchTextChanged()
|
||||
}
|
||||
Keys.priority: Keys.BeforeItem
|
||||
Keys.forwardTo: text && allDesktopHeaps.currentHeap.count === 0 ? searchResults : allDesktopHeaps.currentHeap
|
||||
Keys.forwardTo: text && (allDesktopHeaps.currentHeap.count === 0 || !effect.filterWindows) ? searchResults : allDesktopHeaps.currentHeap
|
||||
text: effect.searchText
|
||||
onTextEdited: {
|
||||
effect.searchText = text;
|
||||
|
@ -351,7 +351,7 @@ FocusScope {
|
|||
color: Kirigami.Theme.highlightColor
|
||||
visible: gridVal > 0 || nearCurrent
|
||||
anchors.fill: parent
|
||||
property bool shouldBeVisibleInOverview: !(container.organized && effect.searchText.length > 0 && current) || heap.count !== 0
|
||||
property bool shouldBeVisibleInOverview: !(container.organized && effect.searchText.length > 0 && current) || (heap.count !== 0 && effect.filterWindows)
|
||||
opacity: 1 - overviewVal * (shouldBeVisibleInOverview ? 0 : 1)
|
||||
|
||||
function selectLastItem(direction) {
|
||||
|
@ -648,11 +648,12 @@ FocusScope {
|
|||
Item {
|
||||
width: parent.width
|
||||
height: parent.height - topBar.height
|
||||
visible: container.organized && effect.searchText.length > 0 && allDesktopHeaps.currentHeap.count === 0
|
||||
visible: container.organized && effect.searchText.length > 0 && (allDesktopHeaps.currentHeap.count === 0 || !effect.filterWindows)
|
||||
opacity: overviewVal
|
||||
|
||||
PlasmaExtras.PlaceholderMessage {
|
||||
id: placeholderMessage
|
||||
visible: container.organized && effect.searchText.length > 0 && allDesktopHeaps.currentHeap.count === 0 && effect.filterWindows
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: i18ndc("kwin", "@info:placeholder", "No matching windows")
|
||||
|
@ -663,7 +664,7 @@ FocusScope {
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width / 2
|
||||
height: parent.height - placeholderMessage.height - Kirigami.Units.largeSpacing
|
||||
height: effect.filterWindows ? parent.height - placeholderMessage.height - Kirigami.Units.largeSpacing : parent.height - Kirigami.Units.largeSpacing
|
||||
queryString: effect.searchText
|
||||
|
||||
onActivated: {
|
||||
|
|
Loading…
Reference in a new issue