Commit graph

45 commits

Author SHA1 Message Date
Roman Gilg
d51b8dc093 [decorations] Let KDecoration plugins recommend a border size per default
Summary:
This is an alternative solution to T8707 and in comparision to D13276 a less
drastic change to KWin's default behavior.

Instead of changing the border size default for all KDecoration plugins by
switching the default from border size Normal to None introduce new
functionality, which allows a KDecoration plugin to recommend a border size in
its metadata. By default KWin listens for these recommendations and sets the
border size accordingly.

If there is no metadata recommending a border size, KWin falls back to the
current setting of Normal sized borders.

A user is able to override the recommendations from the KCM, which has been
extended accordingly.

Test Plan: Manually with adjusted metadata of Breeze.

Reviewers: #kwin, #plasma, #vdg, ngraham

Reviewed By: #vdg, ngraham

Subscribers: hpereiradacosta, filipf, anemeth, davidedmundson, abetts, graesslin, ngraham, zzag, kwin

Tags: #kwin

Maniphest Tasks: T8707

Differential Revision: https://phabricator.kde.org/D13284
2019-06-06 22:24:45 +02:00
Valerio Pilo
8350c0f2ce [kcmkwin/kwindecoration] Rewrite the KWin decorations settings as a ConfigModule
Summary:
* Wrote new KCM based on KQuickAddons::ConfigModule.
* Remade QMLs for Buttons and Themes tabs.
* Updated bridge model code for new plugin lookup API (fixes warnings).
* Fixed decoration shadow changing messing with the previews sizes.
* Fixed button drag and drop issues (see D18104).
* Fixed default settings button behavior and detection of settings changes.
* Updated Get Hot New Stuff.
* Removed apply button in previewbridge.cpp: After applying changes, a theme's KCModule is invalidated.

BUG: 389431
BUG: 350122
BUG: 346222
BUG: 342816
BUG: 397595

{F6574963} | {F6574962} | {F6574961} | {F6574960}

Test Plan:
* Verified saving and loading for every setting
* Checked shadows of Breeze and Oxygen
* Tested all possible drag&drop operations on both sides of the fake titlebar
* Changed color schemes (with `kcmshell5 colors`) while showing the Themes tab to see if all previews update correctly their palettes
* Tested on a fresh Neon-developer account, via kcmshell and systemsettings

Reviewers: #vdg, abetts, ngraham, #kwin, davidedmundson

Reviewed By: #vdg, #kwin, davidedmundson

Subscribers: zzag, GB_2, ngraham, broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18458
2019-02-10 13:01:04 +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
2034e7e875 [kcmkwin/deco] Bring back KNewStuff support
KNewStuff is no longer hard-coded to Aurorae themes. Instead the
availability of KNewStuff is derived from the available plugin
metadata. If the section org.kde.kdecoration2 contains a key
"KNewStuff" it's value is interpreted as the knsrc config file name.
If there is at least one plugin with such a key KNS gets enabled.

If there are multiple plugins providing KNS support the download
button is turned into a button with a connected menu and each menu
entry points to one of the available resources. Of course this is
not optimal, but KNS doesn't allow the combining of multiple config
files.
2014-12-05 10:15:41 +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
d0c83ddbf3 [kcmkwin/deco] Support loading translations for UI loaded configs
Qml based Aurorae themes can provided a ui file which gets loaded at
runtime. Obviously such a ui file is not translated. This introduces
quite a hack to load the translated strings.

First of all a new property is added to the service file for
specifying the translation domain to be used for the config UI. If
such a translation domain is set we extract all string properties of
the loaded UI and pass them through ki18nd.
2014-06-10 15:49:19 +02:00
Aleix Pol
36e93e9c5a Adapt to changes in KDEInstallDirs
Plugins of non kf5 frameworks are not in a kf5/ subdir anymore

REVIEW: 117838
2014-04-28 15:36:44 +02:00
Martin Gräßlin
18a37d7ee8 [kwin] Fix includes of kde4support headers
* drop unused headers
* use QExplicitlySharedDataPointer instead of KSharedPointer
* drop KDE/ from includes
2014-03-18 14:34:36 +01:00
Aleix Pol
c72e519d9c Remove KDE/ prefix in include directories
It's unneeded and deprecated since KF5.
2014-03-17 16:24:10 +01:00
Martin Gräßlin
f74df28450 [kwin] Use KPluginTrader and json metadata to find KDecorations
* A KDecoration needs to include json metadata
* A KDecoration needs to be installed to kwin/kdecorations
* Aurorae and Oxygen adjusted
* kcmdeco locates all decorations through the KPluginTrader
* libkdecoration uses KPluginTrader to find the plugin
* config plugins also need to include json metadata with
  X-KDE-PluginInfo-Name being the same as the decoration
* config plugins need to get installed to kwin/kdecorations/config
* kcmdeco locates the config plugin for a deco through the name
  and KPluginTrader

REVIEW: 116765
2014-03-17 07:41:14 +01:00
Martin Gräßlin
9fc3aabc66 [kwin/aurorae] Default to no close on double click menu button
To increase consistency with other decorations and because it changes
the behavior of the menu button in an unexpected way we default to
double click menu button doesn't close the window.

BUG: 331462
FIXED-IN: 5.0
REVIEW: 116716
2014-03-11 15:46:21 +01:00
Martin Gräßlin
b3d3c45149 Use KPluginLoader to load our decoration plugins
This simplifies the plugin loading. Decorations just have to use
K_PLUGIN_FACTORY to specify how the KDecorationFactory needs to be
created. The KWIN_DECORATION macro is adjusted to generate the
boiler plate code, but it now needs to specify the name for the
pluginfactory and the KDecorationFactory.

This also transits the decoration abi version check to use
K_EXPORT_PLUGIN_VERSION which also simplifies the loading.

As a result the complete canLoad handling in DecorationPlugins is
removed.

REVIEW: 115930
2014-03-03 13:55:52 +01:00
Martin Gräßlin
16c44810cb [kwin] Drop more unused includes
--warnings
2014-02-03 11:45:35 +01:00
Laurent Navet
88fc43beeb kwin : replace Q_FOREACH with for(a:b)
replace Q_FOREACH loops with newer for (a:b) notation

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>

REVIEW: 114222
2013-12-13 08:54:34 +01:00
Martin Gräßlin
07294b49f2 [kcmdeco] Use new DecorationButton types for describing the buttons
Rather heavy change to get the kcm to no longer use the string based
definition of the buttons on the left and right.
2013-11-14 09:41:52 +01:00
Martin Gräßlin
3ea18be574 [kcmdeco] Move KDecorationPreviewOptions into the Model
We need to have it around and not in the Preview widget to be able
to update the options when the buttons change.
2013-11-14 09:41:52 +01:00
Martin Gräßlin
b150d9ddc1 [kcmdeco] Clean up includes 2013-11-14 09:41:52 +01:00
Martin Gräßlin
a98dbd7460 [kcmdeco] Drop the old preview code
All the rendering to QPixmap code in the Model and the Preview is
deleted as it's no longer used.

The model still has the plugin for the border size functionality.
This probably needs a change in the API to make it completely bound
to the decoration and not a global thing.
2013-11-14 09:41:52 +01: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
9caba1cb8d [kcmdeco] Fix finding of all Aurorae themes 2013-10-01 14:05:59 +02:00
Martin Gräßlin
f402fb9ea2 [kcmdeco] No QStringLiteral in a Q_FOREACH
Interesting compile error. Switching to modern for loop fixes the
issue.
2013-10-01 14:05:59 +02:00
Anselmo L. S. Melo
00d507b7ff Porting kcmkwin to Qt5/KF5: QStandardPaths
REVIEW: 111975
2013-08-13 17:55:49 -03:00
Martin Gräßlin
98a04893a6 Use mgraesslin@kde.org for my mail address in Copyright and AboutData 2013-03-12 13:17:53 +01:00
Martin Gräßlin
60c42b7a34 s/KLocale/KLocalizedString/g
Many headers included KLocale to use i18n and co. But those methods are
defined in KLocalizedString and not in KLocale.

With KF5 klocale.h does no longer include KLocalizedString causing lots
of compile errors.
2013-03-07 13:59:15 +01:00
Martin Gräßlin
32b6ef42b9 Strip module path from all Qt #include <>
Done with:
fixqt4headers.pl --strip-modules

REVIEW: 109176
2013-03-06 10:26:56 +01:00
Martin Gräßlin
2aed7b13d1 Cleanup the Preview rendering of Window Decorations
The preview code still contained all the old logic for embedding the
preview into another widget. Most of the code had been dead for quite
some time.

The only preview rendering code now is the one to render into a pixmap.
This is actually changed to render the widget directly at the right
position obsoleting the previous widget positioning code.

The no preview available label is dropped as it did not get rendered into
the pixmap at all.

Last but not least we fake that compositing is on. This has always been
the case for Aurorae themes and just looks better. Especially on Oxygen I
had always had some corruption when rendering this preview with
compositing disabled.

REVIEW: 108777
2013-02-12 11:51:17 +01:00
Martin Gräßlin
25ac108a76 Support for custom configuration dialogs for QML decorations
If the decoration package contains a ui file in ui/config.ui and
and KConfigXT xml file in config/main.xml the configure dialog
is extended by the custom values.

For this the ui file is loaded and included in the dialog's
layout. To make this possible the AuroraeConfigForm is changed
to a VBoxLayout containing the so far used FormLayout.

The configuration settings are loaded using Plasma's ConfigLoader
and attached to the widget through a KConfigDialogManager.

Marking this commit as the one which implements QML support for
Aurorae themes:

REVIEW: 105751
REVIEW: 105768
BUG: 303810
FIXED-IN: 4.10
2012-08-26 20:57:56 +02:00
Martin Gräßlin
8de1fea67e Option to disable window close on menu double click in Aurorae
For each theme the setting can be enabled individually with the
default being enabled by default. It is completely handled
inside the MenuButton QML component so each QML theme benefits
from the option automatically, too.

BUG: 301327
FIXED-IN: 4.10
REVIEW: 106160
2012-08-26 20:56:19 +02: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
f5aaf5272d Manage m_preview::deco pointers on plugin juggling
BUG: 304026
REVIEW: 105721
2012-07-25 20:25:27 +02:00
Thomas Lübking
ddd2b117b1 introduce KDecorationPlugins::canLoad()
so we don't mess up our plugins on reload
also invoke it by loadPlugin()
and fix some KLibrary memleaks

REVIEW: 105499
BUG: 303247
(cherry picked from commit fd272b06954029b554197be1d10e252b01f56502)
2012-07-22 11:18:14 +02:00
Thomas Lübking
bcbd7181f1 don't load incompatible deco plugins in kcm
... and prevent accessing them in addition
shall fix crash Martin documented in
http://git.reviewboard.kde.org/r/105021/

REVIEW: 105379
2012-07-05 19:43:45 +02:00
Thomas Lübking
fd694c5bac Make decoration kcm more responsive
REVIEW: 105021
2012-06-07 12:37:43 +02:00
Martin Gräßlin
f14b2572bf Improve generation of previews code
The layout text is only required for native decorations.
2012-01-27 11:21:30 +01:00
Martin Gräßlin
a1bee6f8a7 Proper button handling in Aurorae QML
Buttons are exported as a global "options" in the factory.
Additionally the theme's buttons are also exported. The thme decided
based on the custom button positions property which one to use.

In the kcm the button options are also exported.
2012-01-13 18:08:45 +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
Martin Gräßlin
0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Martin Gräßlin
4ad998910e Show title in Aurorae previews again.
svn path=/trunk/KDE/kdebase/workspace/; revision=1129399
2010-05-22 08:43:38 +00:00
Martin Gräßlin
5b49fabcfc Hide false-positive krazy warning.
SVN_SILENT

svn path=/trunk/KDE/kdebase/workspace/; revision=1121836
2010-05-02 11:54:22 +00:00
Martin Gräßlin
42021bc3e3 Krazy fix QLatin1String.
SVN_SILENT

svn path=/trunk/KDE/kdebase/workspace/; revision=1121820
2010-05-02 10:37:05 +00:00
Martin Gräßlin
088757cd94 Show deco name and author info directly in each decoration preview.
svn path=/trunk/KDE/kdebase/workspace/; revision=1118057
2010-04-23 19:20:01 +00:00
Martin Gräßlin
cbdec6736a Adding a config dialog for Aurorae themes to change border and button size.
This one does not use the normal plugin infrastructure, but is part of the kcm directly. The plugin would require to have one dialog for all aurorae themes and that just does not work. Aurorae saves settings per theme.

svn path=/trunk/KDE/kdebase/workspace/; revision=1117280
2010-04-21 18:18:45 +00:00
Martin Gräßlin
c9d70cef70 Aurorae supports rendering previews directly, so we can drop the custom preview painting code.
svn path=/trunk/KDE/kdebase/workspace/; revision=1115567
2010-04-16 21:03:34 +00:00
Martin Gräßlin
c9df18ab98 New decoration kcm:
* Displays list with previews instead of a dropdown with just the name.
* Configuration is moved into an own dialog accessible via a configure button for each decoration
* Button configuration is moved into a dialog, by that the tabs are removed
* Aurorae themes are listed just like normal decorations
* GHNS support to download Aurorae themes
* Semi-live preview of changed: when configure dialog is closed the preview is updated
* About Dialog added for each decoration (needs updates in desktop files - the information is missing)

svn path=/trunk/KDE/kdebase/workspace/; revision=1077141
2010-01-19 13:44:22 +00:00