Commit graph

37 commits

Author SHA1 Message Date
Vlad Zagorodniy
fca9dbd011 Merge branch 'Plasma/5.12' into Plasma/5.13 2018-08-15 11:34:03 +03:00
Bo Simonsen
22d898399b [kcmkwin] Use QtQuick.Controls 2.0 for Label and TextField
Summary:
Using QtQuick.Controls for Label and TextField can result in blurry font rendering for a fractional scaling (e.g. 1,5). There is a work around for QtQuick.Controls 2.x therefore using QtQuick.Controls 2.0 for Label and TextField resolves the problem

BUG: 366451

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: ngraham, zzag, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14495
2018-08-15 11:31:00 +03:00
David Edmundson
52e42df9d6 Clean up kwindecoration KCM qml code
Summary:
Remove all instances of anchors in a layout.
This is undefined behaviour (even if it happens to work) and results in
a warning in 5.11.

Resulted in some shuffling about, but generally cleaner code.

Visually looks the same

Test Plan:
Added some buttons
Dragged and dropped some buttons out of the top header
Still got my "drop here to remove button" hint with the same opacities

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12284
2018-04-18 10:57:30 +01:00
Nathaniel Graham
7cde4b1028 Make the Window Decoration themes' Configure buttons more obvious
Summary:
As documented via bug reports and online support requests, many users have difficulty learning that window decorations are customizable, because they don't notice or understand the little icon-only button in the bottom-left corner of each theme preview.

This patch centers the buttons and adds text including the theme name , making it obvious what the buttons are for.

Also, clicking on one of the buttons now automatically selects its corresponding theme, because configuring an un-selected theme doesn't make a lot of sense and could lead to user confusion once this UI is more obvious and widely-used.

BUG: 390245

Test Plan:
{F5761897}

- Clicked on the configure buttons; each one selects its parent theme and opens its configuration dialog

Reviewers: #kwin, #plasma, #vdg, cfeck, graesslin

Reviewed By: #kwin, #plasma, graesslin

Subscribers: richardbowen, zzag, kigwana, rkflx, matheusm, fabianr, abetts, Fuchs, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11201
2018-03-28 11:33:50 -06:00
David Edmundson
3709996f8a Fix KWin decoration KCM showing correct index at startup
Summary:
The KCM has a context property of the currently set theme index. This is
set before the decorations model is populated, so it is currently always
-1.

This model is populated after the constructor but before
KCModule::load().

KCModule::load is called from KCModule::showEvent so before
QQuickGridView will start doing anything with delegates.

This fixes the problem simply and also avoid parsing the config file
multiple times.

This bug was introduced in 5.9.4:

Someone made a (tested) change to make sure the view scrolled to the
right place on startup.
I then made a (tested) commit fixing the crash on exit
The author then updated his patch to my changes, but now in a way that
didn't work.

Test Plan:
Opened system settings module with a million decorations.
The correct entry was visible and highlighted.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5401
2017-04-13 11:54:39 +01:00
Anthony Fieroni
c3362fe866 [kcm_kwindecoration] Respect theme colors in buttons
https://phabricator.kde.org/D5116

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2017-04-12 18:16:41 +01:00
Marco Martin
892f398b10 move the view at the correct index at startup
Summary:
using the same trick as elsewhere, set the currentIndex
and move the view to currentIndex right at startup
the only way to be sure is onContentHeightChanged
as there are no signals for when "the view has been
populated and settled up"

Test Plan:
the view is at the right state since the first frame shown,
no more jumping around effect

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4703
2017-02-24 15:51:53 +01:00
David Edmundson
70d2fb2378 Avoid a crash on Kwin decoration KCM teardown
Summary:
As described in https://bugreports.qt.io/browse/QTBUG-57714  exposing a
QWidget as a context item to QtQuick can crash. Especially as the
engine's context property gets deleted whilst deleting the parent item.

This patch reworks the code so that the models are exposed to QML
directly rather than going through a QWidget.

CCBUG: 373628

Test Plan:
Pressing back whilst in the decoration KCM used to crash every time, now it doesn't.
I still have the buttons.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, cfeck, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D4533
2017-02-10 14:01:09 +01:00
David Edmundson
d0e0f6c88c Align configure button consistently across delegates
Summary:
Currently the configure button is aligned to the win decoration in the
background. This is bound to 40 - the inactive decorations shadow.

This means the configure button ends up in different places across each
item,
looking a bit weird and potentially not even on top of the right
delegate.

This patch aligns the configure button relative to the overall delegate
so that it's in the same place on every item

Test Plan: Looked at KCM

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3526

BUG: 372685
2016-11-28 09:24:55 +00:00
andreas kainz
c08d26b644 grid layout for windowdecoration KCM
RR 128819
2016-09-06 16:22:56 +02:00
Martin Gräßlin
2e68096a24 Merge branch 'Plasma/5.4' 2015-10-21 08:11:38 +02:00
Martin Gräßlin
484e4be7f6 [kcmkwin/deco] Delay deleting of PreviewBridge
Our decoration is deleted using deleteLater() and that might cause access
to the bridge. Given that we also need to deleteLater() the
PreviewBridge.

To do so the PreviewBridge is no longer directly exposed to QML, but
in a wrapper object which holds the bridge as only element.

BUG: 344278
FIXED-IN: 5.4.3
REVIEW: 125724
2015-10-20 14:33:15 +02:00
Thomas Lübking
ed2314dfbe overhaul of deco kcm
- tab theme and button items
- move menubutton close hint below checkbox (moved on top)
- use proper background palette on palette updates

REVIEW: 125393
2015-10-05 23:40:46 +02:00
Thomas Lübking
2e820dbdef do not wrap text in deco button drag source
The text cannot be aligned to the icon (makes
it move around when dragging the icon) nor
can we just allocate two line (makes single lines
detached from the icon)

BUG: 343411
REVIEW: 122301
FIXED-IN: 5.2.1
2015-02-05 21:37:33 +01:00
Marco Martin
63885cc5b3 use xembed for the qml view of window decorations modul
the only way to ensure the view won't randomly become black
(probably QQuickwidget won't be fixed in qt anytime soon or
ever in 5.x lifetime due to how architecturally is)

basically systemsettings has no control of what gets loaded in,
if one other kcm will call winId(), this one will break.

BUG:341971
2015-01-28 09:58:47 +01:00
Martin Gräßlin
3b6ab89617 [kcmkwin/deco] Do not runtime depend on QtQuick 2.4 (Qt 5.4)
Sorry, sorry, sorry! We need better runtime checks on the CI.
2015-01-27 14:08:12 +01:00
Thomas Lübking
ce2fa727e8 Overhaul of deco kcm
- align with system palette
- base color for buttons and preview individually
  to create a visual gap (make them more standalone)
- downsized button config buttons to match up w/ preview
  appearance (and because it was simply to huge for a desktop thing)
- upsized preview to preferably show two elements at once
  (current + 2*1/2context)
- made the titlebar a visible visual element
- label the titlebar "Titlebar"
- move the (altered) hint to the drag-from area
- hint draggability with a pointing hand cursor
- less hardcoded values
- brief animations on button adding/removing

BUG: 337544
REVIEW: 122064
2015-01-22 01:31:31 +01:00
Martin Gräßlin
d5233a6b6f [kcmkwin/deco] Bring back a decoration buttons configuration interface
The decoration button configuration interface is merged into the QML
part using two list views (left buttons, right buttons) and a grid
view for all the available buttons.
2014-12-09 16:07:27 +01:00
Martin Gräßlin
7da6d3a41e [kcmkwin/deco] Add configuration for decoration plugin/themes
This brings back the configuration for decoration plugins. As a change
to the old variant the configure button is moved into the list view
together with the preview. It is enabled/disabled depending on data
provided by the DecorationModel. For a plugin the DecorationModel
queries for a boolean "kcmodule" key in the metadata. For a theme it
invokes the slot hasConfiguration with the theme name which returns
whether the theme provides configuration.

The actual opening of the configuration is triggered from the
PreviewBridge, which uses the existing KPluginFactory to load the
KCModule. The decoration plugin must provide the keyword "kcmodule"
for it.

So far Aurorae is adjusted and provides configuration for the Plastik
decoration. The interaction with the configuration module works, but
the configuration itself for Plastik seems to be currently broken.
2014-12-05 13:44:16 +01:00
Martin Gräßlin
39f9581d4f Bring back configuration options for Decorations
* Border Sizes
* Close menu double click

Both are added to the Settings and exposed in the decoration kcm.
As it started to no longer scale the kcm uses a ui file.

Still missing:
* buttons
* custom decoration configuration
* GHNS
* search
2014-12-04 16:28:06 +01:00
Martin Gräßlin
027a7a1646 [kdecoration2] Decoration::shadow returns QSharedPointer
Adjust all components to use the QSharedPointer. Aurorae obviously has
to create a QSharedPointer, Shadow holds a QSharedPointer for the
DecorationShadow (advantage: is kept when the Decoration is destroyed),
and the KCM needs to add a property on PreviewItem to get access to the
Shadow. It's no longer a Q_PROPERTY on Decoration and we cannot re-add
it as a dynamic property (cannot be read from QML side).
2014-12-01 09:40:24 +01:00
Martin Gräßlin
8dd0a8163f [kcmkwin/kwindecoration] Import a new decoration configuration module
Following features are supported:
* finds all plugins
** finds all themes for a theme-engine plugin
* renders previews for the plugin/themes
* loads currently used plugin/theme
* saves selected plugin/theme
* triggers config reload in KWin

Following features are currently not supported:
* Search
* Plugin configuration
* GHNS
* Button configuration
2014-10-31 07:53:04 +01:00
Martin Gräßlin
8c42df77e0 [kcmkwin/kwindecoration] Mock signals in AuroraeDecoration.qml
This silences some connection failed runtime warnings.

BUG: 336278
2014-06-16 11:37:48 +02:00
Martin Gräßlin
1674824e79 [kcmdeco] Introduce a new PreviewItem for rendering QWidget based decos in QML
Using a QQuickPaintedItem for the rendering. The item gets the library
name from the model and loads the decoration with its own decoration
plugin. Thus each preview has its own plugin which eliminates the need to
constantly recreate the decoration as it is done with the preview.

Having a QQuickItem gives new possibilities. The item accepts hover
events and forwards them as enter and leave events to the widgets inside
the decoration. By that the mouse interaction of e.g. Oxygen is still
functional. If the decoration uses the new update approach the bridge is
forwarding the updates to the item and triggering a repaint so we even
have animations in the preview although the widget is never shown.
2013-11-14 09:41:52 +01:00
Martin Gräßlin
9013f4ac8f [kcmdeco] Use QtQuick2 for the decoration preview list
This introduces quite some changes. We cannot include a QQuickView
directly in the QWidget based UI as a replacement for the
QDeclarativeView used before.

Instead a QScrollArea is used as replacement for the view and a
QQuickView is embedded into a widget container in the scroll area's
view port. This allows us to keep the existing semantic of having a
native scroll bar synced with the list view. It might be an idea to
change this to QtQuickControls in future.

As the list view is now only inside the scroll area we do not need to
pass the slider width to the root context and can by that more easily
calculate the width of one decoration.
2013-10-01 14:05:59 +02:00
Martin Gräßlin
7163c9faf4 Support for Application Menu in Aurorae
Aurorae supports in general the Aurorae button. So far themes are not
able to style the button, instead the window's icon is used.
2013-01-07 09:43:30 +01:00
Martin Gräßlin
ce2b251c9b Support for config values in QML decorations
When the decoration is reset a signal is emitted that the config
might have changed which the decoration can connect to for
reloading its configuration. For this an invokable method is
added to Aurorae allowing to read a config value which just
returns the QVariant.

Proper support for border sizes are added by providing the enum
in DecorationOptions, so that QML themes can use the enum values
to decide which border size to use.

The kcm is adjusted to also support these config mechanisms and
to properly load and save the border sizes for QML based themes.
2012-08-26 20:56:19 +02:00
Martin Gräßlin
249173946a Support for QML based decoration in KCM decoration
Model is extended to support QML based Aurorae themes as well
the preview is able to handle it. For this a new qml component
is added which loads the decoration preview.
2012-08-26 20:56:19 +02:00
Thomas Lübking
3f30a7d6fb enable keyboard navigation for qml deco kcm
REVIEW: 105169
2012-06-09 12:02:59 +02:00
Thomas Lübking
52caeffe22 get rid of hardcoded qml ui elements
REVIEW: 105018
CCBUG: 291612
2012-06-07 12:37:32 +02:00
Martin Gräßlin
98feb9dd3b Ensure scrollbar does not overshoot decoration list
Stop at bounds while flicking to have a list which behaves in a
natural way on the desktop and ensure that the scrollbar
handles cannot overshoot the list.
2012-05-22 18:29:18 +02:00
Martin Gräßlin
38c1e721dc Set maximum highlight move duration in kcm decoration
Ensures that animation finishes after a reasonable amount of
time and does not follow the default 400 pixels/second.
2012-05-22 18:29:18 +02:00
Martin Gräßlin
26ff05b4bd Export highlight color as context property to decoration list
Ensures that decoration list uses the defined highlight color
instead of hardcoded value.
2012-05-22 18:29:17 +02:00
Martin Gräßlin
1e231624cc Add an oxygen styled scrollbar in decoration list
Thanks to Nuno for providing the QML based scrollbar. Obviously
this does not improve the consistency with other widget styles, so
a proper solution is still required.
BUG: 291612
2012-01-20 11:11:45 +01:00
Martin Gräßlin
1f07877adb Move AuroraePreview into a Loader
Makes performance of list a little bit better.
2012-01-13 18:08:46 +01:00
Martin Gräßlin
afae882ba4 Adding scrollbar to list view 2012-01-13 18:08:46 +01:00
Martin Gräßlin
5ce7381f15 Decoration KCM uses QML and loads QML based Aurorae themes
This allows to have the Aurorae themes interactive.
2012-01-13 18:08:44 +01:00