Is there an alternative API for listing installed icon themes? I added functionality to Cuttlefish that uses this and the KCM may use it?
- Queries
- All Stories
- Search
- Advanced Search
Advanced Search
Oct 12 2019
Oct 10 2019
add comment
Oct 9 2019
In D24453#544251, @ngraham wrote:
In D24508#544318, @ngraham wrote:This works, though I'll admit that the custom event filter makes me a bit queasy. Feels kind of like hacking around something that wasn't implemented the right way in the first place (i.e. using a QDialog and QDialogButtonBox). Is porting away from that stuff even worse?
I tried making it a QWidget but then no button was reacting to enter and we would lose close-on-esc which we would then have to implement ourselves. Hey it's, not *that* bad ;). It's an only an handler and not a filter for another widget.
Maybe someone with more experience has another idea? Or we concede that no button can be activated with Enter only with Space.
Also is there a reason why we can't use only PushButtons in the main window? I was surprised to discover that half of them were ToolButtons when I went digging into the code, because they all *look* like PushButtons.
I didn't wrote the code but the obvious reason would be that one can assign actions to ToolButtons. Here it is used with KStandardActions and I use it for the screenshot button to switch easily between states.
remove stray qdebug
Make code more expressive and add comments
Oct 8 2019
Make it possible to have an auto-hiding panel that only appears when clicking on a button somewhere else: https://bugs.kde.org/show_bug.cgi?id=412483
I don't think the point matches the bug report entirely but maybe one could hack something like this together with
https://community.kde.org/Plasma/DeveloperGuide#DBus_autolaunched_Plasmoids or plasma scripting.
Looking at lxr other users include (not exhaustive, I may have missed some)
Konversation
Kexi (don't have it installed),
Amarok,
KPluginSelector (example where it is used?),
KTouch ,
some pimExamples,
nepomuk,
and public transport (optionally).
Set categoryspacing to 0
Oct 7 2019
I could set categorySpacing in KCategorizedView::Private::Private to 0.
But the difference is that in widgets the scrollbar doesn't overlap the contents.
Oct 1 2019
Use paint-none directly
nitpicks
Thanks for accepting this so quickly! Does anyone have any comments on the code? I would like to improve my qml and any suggestion/best practice is welcome.
Sep 30 2019
Show a symbol when a theme doesn't have the icon
In D24305#539727, @filipf wrote:LGTM. Can the overlay be spawned in the vertical center of the window as well or is that defined in Kirigami itself? Also what happens when there are a lot of themes, does the overlay remain the same size and just get a scrollbar?
I didn't look into sizing positioning the overlay yet. But a scrollbar appears if the content doesn't fit into the available size.
Sep 28 2019
My initial thoughts (I was on vacation): Is there really an advantage in using shared libs? You claim it reduces overhead but I don't see in which way. Instead there is a performance penalty in using dynamic libraries compared to having all the code in one binary. Also we are not in a situation where we have that many backends where there would be a significant impact on executable size. Neither do we support a a public plugin framework where one could install third party plugins.
I see no point in this, sorry.
Also interested
Sep 14 2019
In D23905#530814, @Petross404 wrote:In D23905#530765, @davidre wrote:Also CMAKE_CXX_STANDARD_REQUIRED to also set it as a requirement
Like this?
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON)
Sep 13 2019
Also CMAKE_CXX_STANDARD_REQUIRED to also set it as a requirement
Sep 12 2019
In D23891#529990, @ngraham wrote:Will revert.
We should consider renaming the enums or serialized values or adding a comment in the code though, because the way this is written is is confusing and looks wrong (even if it's right).
Did you test this? I think the way it was was correct. A transient window is for example a popup . Only the popup is transientOnly (capturemode window under cursor) and everything is transientwithparent. See also the help text
-u, --windowundercursor Capture the window currently under the cursor, including parents of pop-up menus -t, --transientonly Capture the window currently under the cursor, excluding parents of pop-up menus
and the gui version
https://cgit.kde.org/spectacle.git/tree/src/Gui/KSWidget.cpp#n217
Sep 5 2019
In D23712#525974, @ngraham wrote:There are some inline comments that aren't done yet. Also, the slider's text label still says 81 and 162 instead of 64 and 128 for the last two slider values.
In D23446#525891, @Leon0402 wrote:I'm not sure about the structure of the tableModel. Thinking about it we don't really have a table structure of items but a list. Also it seems you are mixing columns an roles. Your model advertises itself with 3 columns but only has data 2 and each column in a row refers to the same item.
I'm not quite sure what you mean with your last sentence, but in general I think a tableModel is suitable. It has three pieces of data each row. What exactly is done with it, how it is displayed in the end etc. has nothing to do with the model anymore in my opinion. I couldn't find an official statement about roles, but I liked this explanation from StackOverflow "A role is simply an additional selector used when accessing data of a model." -> So again I would say, each column could be accessed by a different role and displayed in a different way (or not displayed at all). For me three columns just means, each delegate uses three pieces of data and that's the case.
But anyway there is more than one way to go and I don't persist on using a tableModle, in fact, I'm totally fine with using a QAbstractListModel. Seems reasonable to me as well!
I'm also not that experienced in that area but in my mind you would use a tablemodel where you have items in table like structure and Roles to access different aspect of the items. So a list with multiple roles would fit here better.
hen introducing a TooltipRole to access the the tooltip through the index.
I'm not a fan of this though. It is not a tooltip (and would therefore confuse me to give it that role) and it will probably also not work as delegates come with code to display / use the data of the different roles automatically. So if you would set the toolTipRole and call the paint() method of the delegate, it would actually become (additionally) a tooltip.
Instead I would override QHash<int, QByteArray> QAbstractItemModel::roleNames() const and introduce a new UserRole "shortcutRole" or anything like that. I could also make a custom role for the action. It was confusing to me when I first saw the code, what that information is, because "Qt::UserRole" is not really descriptive. So I would suggest to also introduce a second custom role called "actionRole". This is not super important to me, I just think it would make the code a little bit more readable.Would that be a good compromise? Would you leave the third data as Qt::UserRole or introduce a new role like ActionRole (as we override roleNames() anyways)
You're right of course, I was somehow thinking about tooltips when I meant shortcuts. Yes that would be the way for an additional role. You crename Qt::UserRole to give it a more descriptive name. Take a look here for example: https://cgit.kde.org/plasma-workspace.git/tree/wallpapers/image/backgroundlistmodel.h#n61/backgroundlistmodel.h#n61
I'm not sure about the structure of the tableModel. Thinking about it we don't really have a table structure of items but a list. Also it seems you are mixing columns an roles. Your model advertises itself with 3 columns but only has data 2 and each column in a row refers to the same item. So I would suggest switching to QAbstractListModel and then introducing a TooltipRole to access the the tooltip through the index.
This also applies the delay of 250 ms when saving the picture not only copying. To make this better we could move this either inside the if-else above or have another test if we copied to clipboard - can't get around a bit of duplication. However this piece of code is all over the place already and I don't like the design of forceNotify and quitting through the main window. So this if fine with me if we could avoid the extra wait when saving to a file.
Sep 4 2019
Sep 3 2019
As you can see in my snippet it would be controlled by a bool which visible is bound too. If the labels are shared between states you could control the visibility of the labels visible:realeasetoCpature&&Normal. No need for something so complicated as multiple files or js code. Anyways this is offtopic.
My point is that we don't have dynamically changing text/data but multiple (at the moment two) cases with static text. Note that we know which cases we have and which text we want to show. I don't see any benefit here only overhead. Instead of adding the Labels directly in the if-else you have the same if-else were you save the strings into a class member only to read them right afterwards (the only time where this member is used. Because of current limitations (QGridLayout) the for loop might be needed. What about combining the two methods and making it a local variable or suplying it as an argument to createLayout?
In D23687#525089, @The-Feren-OS-Dev wrote:
Seems to work fine. I don't know if it's the right metric but make sure it also works with different widget styles and reverse layout (try spectacle --reverse).
Still not a fan of the the table model but I will not request to change it. Just note that if you get a valid index in rowCount and ColumnCount you have to to return zero. (See documentation of QAbstractItemModel).
I think this should be good to go then if you remove the new Action in the ActionCollection.
As I said before this patch should not add new shortcuts. Also the way you did this will not work. The action has no correspondence in the desktop file to make it work when Spectacle is not running nor do you connect anything to the action.
One additional thing which would be awesome is that the text dynamically changes if a shortcut is changed. You can look into KGlobalAccel::globalShortcutChanged(QAction *action, const QKeySequence &seq) for that.
I think that's fine. Should also go to stable
For testing on Wayland I rebased this on master. Works now perfectly on X and Wayland! While testing I noticed that my attention follows the mouse cursor while moving the rectangle. Would it be possible to show the Text not on the Screen where the center of the rectangle is but that it follows the mouse cursor?
+1
Mouse/keyboard actions should be the same e.g. shift should active fine-tune with mouse and alt should active magnifier with keyboard. This would allow to write a more compact help text.
Agree. I'm also not a fan of (+ key: action). Bu what about resizing then which is also Alt? Maybe it would be enough to do
Shift: Toggle magnifier/Fine tune selection
or
Shift + arrow keys: Fine tune selection Shift + mouse: Toggle magnifier
Also I don't like Click here and drag. Just "drag" is maybe sufficient.
I just had another idea: We have multiple controls for the same action. What about switching the order of Layout around:
Take screenshot: Enter or double-click Create new selection: Drag outside the current selection Move Selection: Arrow keys Drag the current selection Resize Selection: Arrow keys + Alt Drag drag handles ( <-- kinda meh) Fine-tune Selection: Arrow keys + Shift Toggle magnifier: Shift while dragging Reset Selection: Right click Cancel: Escape
In Menus there is also first the Action then the shortcut.
rebase
David's comments
Remove unneeded header
Sep 2 2019
I talked with Kai and we need the connection in line 341 for not plasma implementations of notifications. So best to restore it and also update the condition there.
The reason it's transparent is because the clear color of the buffer is set to the background color when it's changed [1][2].
This worked before probably because the Color was (0, 0, 0). For transparent windows we need to set it to Qt::transparent[3] and enable an alpha buffer[4].
I will test with multiple screens tomorrow.
A FormLayout seems to fit our purpose much better than a GridLayout.
I find the design of the new class a bit complicated: Why have the createTextModel-> textModelChanged->createLayout chain and the strings as class member for what is essentially static data? (Additionaly the methods are only executed once). Just creating the Labels directly in the constructor would be much simpler.
Sep 1 2019
In D23534#523826, @aprcela wrote:In D23534#523735, @davidre wrote:Curious that it seems to work without it. @broulik is setting the URL enough for clicking it to open the image? Is this handled by KNotification then? Also will this only work in Plasma or would the connect still be needed for when not under Plasma?
I tested only on plasma. If Spectacle is launched this way: `spectacle -b' , than it saves the image to the default location and shows the notification. The thumbnail in the notification appears after a very short time tho (less than half a sec) .
Curious that it seems to work without it. @broulik is setting the URL enough for clicking it to open the image? Is this handled by KNotification then? Also will this only work in Plasma or would the connect still be needed for when not under Plasma?
Really set role to Panel
Aug 30 2019
I would like this or another fix for Applications 19.08.1 (tagging on Monday). Otherwise we would have to think about what to do/which broken version to retain. Being able to select all screens but not the panel or reverting D23346 and being able to select everything on the primary screen but nothing on the other screens.
Aug 29 2019
We need the x-kde-force-image-copy hint for Klipper.
Aug 28 2019
BUG: 389694
I don't know if this fixes the bug completely. If you read the comments there are multiple ways described to cause spectacle to stay open.
Maybe rather CCBUG?
Yes correct
Looking at this the connect should be outside the if instead of just adding it outside the if.
When I added this in c6ad1d6ae9291685b2767ab70bdeaaadb7783658 there was no if. I think that's because of the cherry-pick in 7f30ee858368695a10ebbe628aabf0ef688f60cf?