aboutsummaryrefslogtreecommitdiff
path: root/src/gui
AgeCommit message (Collapse)Author
2022-05-30Change "Actual Size" shortcut's text to "Zoom to Actual Size"Nate Graham
In general actions need to start with verbs so that the user knows what will happen. Changing "Actual Size" to "Zoom to Actual Size" makes the action compliant with this rule, and also makes it clear that this is a zoom action, so anywhere the user searches for the word "zoom", they will find it.
2022-02-25Remove broken Python bindings generationFriedrich W. H. Kossebau
pyqt broke sip4 compatibility in 5.15.6, and there is no more maintainer of the KF Python bindings to fix things. Future support might need different code, so no advantage in keeping the old code around.
2022-02-24Add KWindowStateSaverVolker Krause
This is basically the C++ counter-part to https://invent.kde.org/frameworks/kconfig/-/merge_requests/94 and allows to easily retrofit window size persistence on existing windows/ dialogs, replacing e.g. code like https://invent.kde.org/pim/pimcommon/-/blob/master/src/pimcommon/widgets/kpimprintpreviewdialog.cpp. This is a bit more complicated than one might expect, as KWindowConfig works with QWindows, but that's something freshly created QWidget windows/ dialogs don't have yet. Additionally, we are in a library here that doesn't depend on Qt::Widgets. To overcome this we move the widget-dependent code (basically just a call to QWidget::windowHandle()) to inline template code (and thus into the consumer), use std::function's type erasure to pass it into the library code, and an event filter on the widget to wait for the QWindow to become available.
2022-02-14Support build without Qt session managerKai Uwe Broulik
Rather than abort the build, don't create a session config and print a warning. Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-14Support build without Qt session managerKai Uwe Broulik
Rather than abort the build, don't create a session config and print a warning. Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-14Add KConfig GUI logging categoryKai Uwe Broulik
Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-09API dox: brush over KCoreConfigSkeleton & KConfigSkeleton docsFriedrich W. H. Kossebau
NO_CHANGELOG
2022-01-24Fix build on WindowsAlbert Astals Cid
2022-01-24Introduce StandardShortcutWatcher to watch for runtime changesDavid Redondo
Currently an application needs to be restarted before it can see any changes made to the standard shortcut configuration. To notify about changes a new class is introduced that looks for those changes using KConfigWatcher and also updates the global map. CCBUG:426656
2022-01-15Add KF*/KConfig to the interface include directoriesAhmad Samir
So that #include <kconfig_version.h> still works after changing its location in the previous commit. NO_CHANGELOG
2021-12-16WIP: Change the build system to enable building with Qt 6Ahmad Samir
This was built with: -DQT_MAJOR_VERSION=6 \ -DEXCLUDE_DEPRECATED_BEFORE_AND_AT=5.90.0 \ -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055a00 Move the include(KDEInstallDirs) call before the first find_package(Qt*, the former is what auto-detects the Qt version, and defaults to 5. This is needed to be able to build against Qt5 by default. All unit tests still pass.
2021-11-14Avoid some allocations by QString/QByteArray's toLower()Friedrich W. H. Kossebau
NO_CHANGELOG
2021-08-29Add Ctrl+Alt+Comma shortcut for "Configure Keyboard Shortcuts"empyreal one
BUG: 441537 FIXED-IN: 5.86
2021-08-18Port to QStrinViewAhmad Samir
Now that KF requires Qt 5.15.2; this basically reverts commit 2e8742e64fc0 with some trivial changes. NO_CHANGELOG
2021-05-27Use more target-centric cmake codeFriedrich W. H. Kossebau
NO_CHANGELOG
2021-05-09Revert QStringView portAhmad Samir
QStringView has some bits of API that were only added in 5.15.2, whereas KF requires 5.15.0. This reverts commit 1780fb2a237af80ddc1f9cfb70cb892b53b91990.
2021-05-07Order macro for attribute for symbol export before that for deprecatedFriedrich W. H. Kossebau
The symbol export/visibility attribute is not standardized so far and needs to be set by language extension attribute declaration at least with clang & MSVC, who both support that when it appears before the standard attribute declaration. NO_CHANGELOG
2021-05-04Don't write position data for maximized windowsNate Graham
A window that is maximized does not really have a position on screen other then the fact that it's maximized, and writing out position data in this case anyway will only serve to mis-position the window once da-maximized, should KWin ever stop remembering de-maximized window positions internally. CCBUG: 434116
2021-05-02Port away from ECMSetupVersion's deprecated *_VERSION_STRING CMake variableFriedrich W. H. Kossebau
NO_CHANGELOG
2021-05-02Minor code refactoringAhmad Samir
Some methods in ConfigLoaderHandler always returned true, change them to return void instead. Also port them to take a QStringView instead of QStringRef, this doesn't require a lot of changes because a QStringView can be constructed from a QStringRef. QXmlStreamAttribute methods like value() and name() return QStringRef in Qt5 and QStringView in Qt6, "fix" the issue by using auto keyword, which works in both cases. QStringView::toInt() isn't efficient in Qt5 so make the build conditional. NO_CHANGELOG
2021-04-26Use new version-controlled enumerator deprecation warning macrosFriedrich W. H. Kossebau
2021-04-10Relicense to LGPL-2.0-or-laterAndreas Cord-Landwehr
All named authors from copyright statements confirmed this change (confirmations at sysadmins' longterm archive). From the git history check, relicensecheck tells: - lgplv2+: mdawson pandom79@gmail.com mdawson ( 6 LOC): 0005ba7 pandom79@gmail.com ( 4 LOC): eeb2bbe Whereas pandom79 does not posses a KDE contributor account but also confirmed via private mail (confirmation mail also in sysadmins' archive). Change 0005ba7 is a syntactical replacement of QT_TRANSLATE_NOOP with QT_TRANSLATE_NOOP3 and thus can be assumed to not by copyrightable.
2021-04-10Relicense to LGPL-2.0-or-laterAndreas Cord-Landwehr
All named authors from copyright statements confirmed this change (confirmations at sysadmins' longterm archive). From the git history check, relicensecheck tells: - lgplv2+: pandom79@gmail.com pandom79@gmail.com ( 7 LOC): eeb2bbe Whereas pandom79 does not posses a KDE contributor account but also confirmed via private mail (confirmation mail also in sysadmins' archive).
2021-03-06Optimise string operations a bitAhmad Samir
- Use QString::arg(Args...) instead of .arg().arg() - Use QLatin1String for string comparisons, should be faster - Use QLatin1String::arg() for better readability - Add the comment dfaure suggested in the MR, to explain why it's '2%' then '%1' in a QString().arg().arg() NO_CHANGELOG
2021-02-22Fix formatting in a couple of places after running clang-formatAhmad Samir
NO_CHANGELOG
2021-02-22Run clang-format on all cpp/h filesAhmad Samir
NO_CHANGELOG
2021-02-22Add a trailing comma to last member in enumAhmad Samir
GIT_SILENT
2021-02-08Fix window positioning regression due to incorrect fallback in fallbackNate Graham
We have a fallback string that gets searched for in the KCM, but that fallback itself should not have a fallback, or else we always use that second fallback and the window gets positioned incorrectly the first time it's opened. So let's replace the second fallback with -1. BUG: 432661 FIXED-IN: 5.79
2021-02-06Minor code optimisationsAhmad Samir
- Use a global var for a QString that's used many times - Break up long-all-cap variable names, it makes it harder to read (and I've fixed one typo in one of those ALLCAPS) - Fix some clazy warnings, make global QString objects in unit tests static (so that the compiler doesn't create symbols for them, it doesn't matter in a unit test but KF code acts as a reference sometimes that others copy from, tip from dfaure) - Add TODO note about changing kconfig_compiler to generate C++ code that uses multi-arg QString::arg(QString, QString, QString) instead of QString::arg().arg() - More const; more QString::at() instead of operator[] where appropriate - Use a ternary where it makes the code more readable (and uses less lines :)) NO_CHANGELOG
2021-02-02Refactor window geometry save/restore code to be less fragileNate Graham
This commit refactors the code a bit to define the window geometry strings in one place and uses a common method to read and write them. This makes future changes much less fragile and fixes a pre-existing bug that had gone un-noticed which caused window positions to not be saved on a per-resolution basis in addition to a per-display-arrangement basis. Old strings are used if available to that people don't lose their saved position data the first time they upgrade to KF 5.79.
2021-02-02Fix restoring window size when closed while maximizedNate Graham
The maximization string was being saved to the config file including the connected screens, but the code to read it was not, and was also looking for the old incorrect format. This could have resulted in old config values being used forever, and the window always being opened in a maximized state. BUG: 430521 FIXED-IN: 5.79
2021-01-29Replace KF5_VERSION with KF_VERSIONNicolas Fella
Frameworks will be Frameworks 6 at some point and there is no good reason to have the major version in the variable name. Given this is purely internal we can to this now, making it a bit more future-proof GIT_SILENT NO_CHANGELOG
2021-01-14QString::split(QChar, Qt::SplitBehavior, ...) is already in Qt 5.14Friedrich W. H. Kossebau
NO_CHANGELOG
2020-12-10Remove unused includeNicolas Fella
2020-12-10Use | instead of + for combining keysNicolas Fella
The latter breaks with Qt6
2020-12-09Fix windows being inappropriately maximized on launchNate Graham
When a window is closed while maximized, we write a special string to the config file so that it gets restored in its maximized state. But we don't ever delete that thing when the window is un-maximized and closed again, causing the window to always be maximized when launched. BUG: 426813 FIXED-IN: 5.78
2020-12-08Correct format of window maximized stringNate Graham
All other resolutions are stored in the form of width x height, but a silly transposition error had the maximized strong being height x width. That's fixed now.
2020-12-07Fix window sizing and positioning on WindowsNate Graham
The feature to make windows remember their sizes and positions across screen layouts relied on calling QScreen::name() to identify screens. Unfortunately this function returns garbage on Windows; see https://bugreports.qt.io/browse/QTBUG-74317 So on Windows, let's identify displays by serial number as a workaround. BUG: 429943 FIXED-IN: 5.78
2020-11-02ConfigLoaderHandler::parse(): fix inverted sanity check logic at parse endFriedrich W. H. Kossebau
No caller cares for success flag, so this just has confused human code readers for now. NO_CHANGELOG
2020-09-04Drop outdated note about updating kdoctools/genshortcutents.cppFriedrich W. H. Kossebau
genshortcutents.cpp disappeared from kdoctools during preparations of kdelibs for KDE Frameworks (commits.kde.org/kdelibs/64537ae5bf1a4e91ba99befc016e67e8e0c9dff0) Cmp. also http://lists.kde.org/?t=137113303000003&r=1&w=2
2020-09-03Make KWindowConfig::allConnectedScreens() static and internalNate Graham
It doesn't need to be public since it's just an internal convenience function. So let's make it static. BUG: 425953
2020-09-03Fix @since tag for recently-added functionNate Graham
2020-09-01Missing g_infoStandardShortcut update for last commitFriedrich W. H. Kossebau
GIT_SILENT
2020-09-01Fix placement of new CreateFilder enumeratorFriedrich W. H. Kossebau
Needs to be added at end of list for ABI reasons. GIT_SILENT
2020-08-29Add standard shortcut for "Create Folder"Domenico Panella
2020-08-25Remember window sizes on a per-screen-arrangement basisNate Graham
This is done for window positions, so it should also be done for window sizes. The combination of both should substantially improve the use case of maintaining a consistent window arrangement for multiple display setups (e.g. laptop and laptop + external screen).
2020-08-25Extract code to get list of connected screens into a re-usable functionNate Graham
Right now it's duplicated twice, and once we add per-screen-arrangement memory for window sizes as well, it will be duplicated four times unless we put it into a function.
2020-08-12Categorize standard shortcutsDavid Redondo
We have a huge amount of standard shortcuts. By adding the ability to divide them into categories, they can be presented to the user in a way that enables them to easier find the shortcut that they want. Internally some shortcuts were already grouped but that seems to have stopped for the later additions. (The related standard actions from KConfigWidgets also seem to have this not exposed internal grouping.) See plasma-desktop!26
2020-08-02Add functions to save and restore window positions on non-Wayland platformsNate Graham
These functions allow an application to save and restore the positions of its windows. Positions are stored on a per-screen-arrangement basis. For example with a single screen connected, the config file would have entries like this in it: eDP-1 XPosition=140 eDP-1 YPosition=340 When a second screen is connected, the following gets saved: eDP-1 HDMI-1 XPosition=3878 eDP-1 HDMI-1 YPosition=29 This ensures that each separate screen arrangement can have its own saved window position, which is handy for the use case where you have a laptop that you plug into an external screen some of the time. It also allows the position to get restored to the correct screen when there are multiple screens. This is a necessary first step to getting KDE apps to save their window positions on X11 The next step would be calling the new functions from KXMLGui and Kirigami apps, and then porting all apps that manually invoke KWindowConfig::saveWindowSize() and KWindowConfig::restoreWindowSize() to also invoke KWindowConfig::saveWindowPosition() and KWindowConfig::restoreWindowPosition() in the same places. The functions only work on X11 or other non-Wayland platforms. On Wayland, the compositor has sole dominion over window positioning so a compositor-specific solution much be adopted instead, such as https://bugs.kde.org/show_bug.cgi?id=15329. CCBUG: 415150
2020-06-22Also pass locationType to KConfigSkeleton when construction from groupArjen Hiemstra
locationType is used to determine where the config file should be saved. If it is not passed on to the KConfigSkeleton constructor, the default (GenericConfigLocation) will be used and any value the application had set will be ignored.