Scrolling past the first or last desktop asked the pager model to switch to the
current desktop, which toggles Show Desktop when that option is set for clicks.
Only change the page from the wheel handler when it is a different one.
BUG: 471241
Pager's WindowModel adds a StackingOrder role (with rolename
StackingOrder), but the source model already has this role with
the same rolename. When we try to get the new property from qml for
a delegate, we get many warnings of the type:
qt.qml.propertyCache.append: Final member StackingOrder is overridden in
class QQmlDMAbstractItemModelData. The override won't be used.
The two properties (AbstractTaskModel's StackingOrder and pager's
StackingOrder) usually give the same result, so there doesn't seem to
break anything badly, but we can get rid of the warnings (and get the
value as originally inteded) by giving the WindowModel role a unique
name (PagerStackingOrder).
With "Show application icons on window outlines" enabled, the icons
stay at the small icon size (16 px at 100% scale) no matter how large
the panel or the windows are.
Size the icon from the smaller side of the outline, keeping the same
spacing as before, and raise the cap to iconSizes.medium. Small window
outlines get the same icon size as before.
BUG: 518625
The label is created with a createObject call, which fixes the
label and icon values in place on creation. This commits adds
a binding so that they update over time.
BUG: 522322
BUG: 501660
BUG: 506247
For a while, we used "qmllint disable unqualified" on lines containing
i18n calls to get the linter to shut up about them. The better way to do
this (since Qt 6.11) is to register them with qmllint as context
properties, which we now do centrally for the whole project.
So remove them all. This reduces noise in the codebase, and will still
show other unqualified lookups on the same line, making it possible for
qmllint to find them.
ifdefing xwindowtasksmodel.h and KX11Extras
Uses available HAVE_X11; amends 58a6fc0745
So far this required plasma-workspace to be built with -DWITH_X11.
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
When a (virtual desktop) pager is on the desktop and the user
switches activities, it will cause a runtime error. As far as I can
tell, this is because the widget itself is not switching activities,
and can't access the proper tasks model for the virtual desktops on
the new activities. The specific cause of the runtime error is the
desktopId binding, which is only used for drag&drop handling, so is
not relevant while on a different activity's desktop.
Instead, access the property only if the task model is actually there.
The pager applet uses several properties to set the number of rows and
columns for the virtual desktop grid. This causes a binding order issue
that happens when the number of rows is reduced, and for desktop widgets
during startup: the layout (during the intermediate stages) is too small
to fit everything. The problem is easiest to follow with row changes:
assume a 2×2 grid, rows is bound to effectiveRows (calculated to be
2), columns similarly for effectiveColumns. Now we chenge the layout to
be a single row, so it should be 1×4. If effectiveRows and the rows
binding on it is updated first, it will now be 1, yielding a layout of
1×2, which is not large enough to fit the 4 virtual desktops, causing
Grid to complain loudly.
Instead, we change the binding for rows and columns to be the virtual
desktop count if effectiveRows × effectiveColumns is too small. This way
the intermediate stage is guaranteed to be large enough, and after the
other one is updated it will settle on the correct value when the
changed signal updates the binding.
This change adds translation contexts to all translatable strings in qml
files that did not have any. Occasionally, the existing translation
contexts are updated for consistency with the newly added ones.
The string themselves are unchanged, save for one instance where the
Accessible strings were somewhat awkward and were a bit streamlined, and
one set of accessible strings in PanelConfiguration that were not
marked as translatable, but are now.
Co-authored-by: Nate Graham <nate@kde.org>
- Switch to required properties and ComponentBehavior: Bound
- Make some types explicitly defined
- the usual: qualify properties, mark i18n calls unqualified, unversion
imports...
The Pager's "Configure Virtual Desktops" context menu option fails to open the associated KCM on X11, because its name is `kcm_kwin_virtualdesktops_x11` instead of `kcm_kwin_virtualdesktops`. This commit adds session type detection and opens the correct KCM depending on whether the session is running under Wayland or X11.
desktopPositionsChanged was reconnected every time refreshDataSource was
called, since this is called often, after a while connections
accumulated and can go as far as causing a several reconds freeze
every time desktopPositionsChanged was emitted.
Like the other connections, disconnect before reconnecting
When the virtual desktop order is changed from the desktop grid effect, listen to the positions change and reorder the model to reflect the same order in the pager
Due to refreshing the pager twice on mouse release and having two
different mouse drag tracking areas, these could get out of sync.
This caused the pagerModel refresh too early and lose any changes.
This changes it to only refresh after mouse is released, either when
dragging a window or clicking a desktop.
BUG:500236
The StackingOrder is a int; trying to convert it into a
QList resulted in an always-empty list, which then gave
us 0 as the stacking order of any window.
BUG:497506
The pager applet provides a miniature of the virtual desktop grid and by
default, it's placed in the panel. On the other hand, the main purpose of
animations is to notify or guide the user through state changes. Due to
the location and the size of the pager, the user focus will likely be
elsewhere and these animations will go unnoticed.
Unfortunately, these animations have caused some issues too. One was with
drag and drop. 463b6798ae attempted to
address that by dropping x and y animations. That change should have
probably dropped width and height animations too because they alone don't
serve the real purpose. Another issue is caused by flaws in the animation
driving code in QtQuick, which can result in plasmashell triggering
constant repaints until the panel that contains the pager is shown again.
So, given the aforementioned issues and small net benefit of these
animations, this change drops animations in the pager. It is not the
definite fix for upstream issues but it should at least help us mitigate
repaint issues that can be observed on setups with the current defaults.
CCBUG: 487895
The virtual desktop version of the pager contains a context menu entry
that allows directly accessing the corresponding kcm, as does the
activity bar widget. The activity version of the pager, however, does
not have easy access to the activity kcm.
This change adds such an entry to the context menu and adds translation
context. It also removes the ellipsis from the "Show Activity Manager"
menu entry, as the activity manager is shown without further user input.
Hiding window outlines makes for a cleaner look if you're typically
just using the pager to switch desktops/activities.
The default settings remain intact (visible window outlines).