Commit graph

11 commits

Author SHA1 Message Date
Carl Schwan
1dcf514e21
Don't compare string with empty string
Summary: Instead compare string length with an integer

Test Plan: Compile && run

Reviewers: #plasma, iasensio

Reviewed By: iasensio

Subscribers: broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29772
2020-05-29 22:50:01 +02:00
Ismael Asensio
91eee99fca [kcm/kwinrules] Extend upper limit of position and size spinners
Currently, the spinners used to edit position and size rules have an upper
limit of 4098, which may be not enough for wide/hdpi/mutiple screens.

The property itself has no such limit in the `.kcfg` schema
This is just an issue with the editor.

BUG: 421892
FIXED-IN: 5.19
2020-05-22 16:03:32 +02:00
Ismael Asensio
db7fb26eed [kcm/kwinrules] Fix size properties not being stored
Summary:
Use `QSize`/`QPoint` to handle and store coordinate values (size and position)

Previously, the rules model stored the "coordinate" type properties as a
`QString` with format `x, y`.

This fails when setting the properties to the config schema, as it requires
a proper `QPoint` or `QSize` value, specially the latter which can't be
convert from such a string.

BUG: 421055
FIXED-IN: 5.19.0

Test Plan:
- Add a new rule and set its position and size properties
- Hitting apply stores the right values in `~\.config\kwinrulesrc`
- Close the kcm and reopen, the values are loaded
- Property detection still works for size and position

Please note that there is a pre-existing bug of some position/sizes not being
applied to the windows in some cases, when using `Apply Initially`.
Better try using the `Force` policy.

Reviewers: ngraham, #kwin, #plasma, zzag

Reviewed By: #kwin, #plasma, zzag

Subscribers: zzag, ltoscano, yurchor, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29764
2020-05-15 19:45:11 +02:00
Ismael Asensio
973957127d [kcm/kwinrules] Fix placeholder message in RulesEditor
Summary:
Fix the anchoring of the placeholder message after https://phabricator.kde.org/R108:9e5498238f88ece28f4f0d22da00879280cb7955
It needs to center on the free space, not the whole ListView.

Test Plan
Before: {F8323417}
After: {F8323416}

Reviewers: ngraham, broulik, #vdg, #plasma

Reviewed By: ngraham, #vdg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29783
2020-05-15 19:44:43 +02:00
Nate Graham
9e5498238f [kcmkwin/kwinrules] Set saner width for Placeholder messages so they don't overflow
See D29692
2020-05-12 14:12:04 -06:00
Ismael Asensio
471554b7a3 [kcm/kwinrules] Fix layout misalignment of list items
Summary:
Remove anchors within `Kirigami.AbstractListItem` delegates.
They were causing random misalignment of items in the main and the overlay `ListView`s

Test Plan:
Before {F8284332}
After {F8284333}

Reviewers: broulik, #vdg, #kwin, ngraham

Reviewed By: #vdg, ngraham

Subscribers: ahiemstra, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29423
2020-05-06 20:22:25 +02:00
Ismael Asensio
1a3cb256d7 [kcm/kwinrules] Improve export buttons
Summary:
Small UX improvements when exporting rules

Add a `Select All` button
Disable `Save` if no rules are selected
In export mode set button text to `Cancel Export`

Test Plan: {F8276279}

Reviewers: #kwin, #vdg, filipf

Reviewed By: #vdg, filipf

Subscribers: filipf, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29341
2020-05-02 19:43:02 +02:00
Nate Graham
f9faa94ccc [kcmkwin/kwinrules] Port placeholder message to Kirigami.PlaceholderMessage
Summary: Depends on D29152

Test Plan:
{F8256396}

{F8257685}

Reviewers: iasensio, #kwin, zzag

Reviewed By: iasensio, #kwin, zzag

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T13021

Differential Revision: https://phabricator.kde.org/D29141
2020-04-24 08:30:07 -06:00
Ismael Asensio
a158d3cbd3 Rules kcm: Use new property ComboBox.currentValue
Summary:
Use the properties `valueRole` and `currentValue`, introduced in Qt5.14 for `QQC2.ComboBox`

This didn't work before due to QQC2 version being mis-detected at build time, so the code mocked an internal `currentValue` property.

After D28859, it is now required to fix:
   "file:///home/nate/kde/usr/share/kpackage/kcms/kcm_kwinrules/contents/ui/RulesEditor.qml"
   "Error loading QML file.\n42: Type RuleItemDelegate unavailable\n68: Type OptionsComboBox unavailable\n35: Cannot override FINAL property\n"
   QCoreApplication::postEvent: Unexpected null receiver

Test Plan:
Try to edit a rule or add a new one.
The rule editor page shows.

Reviewers: ngraham, #kwin, zzag

Reviewed By: ngraham, #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29145
2020-04-24 15:09:51 +02:00
l10n daemon script
8c7956b923 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-04-23 06:36:52 +02:00
Ismael Asensio
a04b40dadb KWinRules KCM Redesign
Summary:
Replacement KCM to configure kwin rules, using a QML-based UI.

After some work on the task T12729, it is almost feature-par with the previous module, and adapted to the recent move to KConfigXT.

Test Plan:
{F8208046}
{F8208047}

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

Reviewed By: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag

Subscribers: ngraham, davidedmundson, hchain, broulik, zzag, kwin

Tags: #kwin, #vdg

Differential Revision: https://phabricator.kde.org/D28152
2020-04-22 21:34:48 +02:00