Closed psifidotos closed 4 years ago
Ah, looks like I gotta move this function to be a static function. this
can be replaced by casting the unused decoration.
How does it know to use namespace Breeze { static Button::create }
?
I tried moving buttonCreator to a static function (static Decoration::createButton
), but it doesn't seem to work.
Thanks, I'm on the right track.
Had to also create an explicit CommonButton(QObject *parent, const QVariantList &args)
contructor.
Breeze doesn't use m_flag = FlagStandalone
, but it does use m_iconSize = QSize(-1, -1)
to set the iconSize to m_iconSize = geometry().size().toSize()
when painting.
I've managed to get buttons in applet-window-buttons, and the hover effect is visible. I just need to correctly paint the icons.
nice!! ;) window buttons everywhere!!! :) I liked your decoration a lot! Only issue is that in my computer with very high resolution 2560x1440 the window titlebar is really really thin and I can not grow it a bit.
Uhg... the reason why there's no icon, is because it's a CommonButton instance. It doesn't use CommonButton::create()
, that's for ButtonGroup
. registerPlugin
only uses CommonButton(QObject parent, QVariantList args)
to create instances.
So Close/Maximize/Minimize need to have their logic moved out of the descendent classes into CommonButton
like Breeze. No wonder Breeze only has 1 button class.
registerPlugin
has a CreateInstanceFunction
argument, but I've seen no examples I could use.
I've managed to get it working. I'll be moving the fg+bg color logic into CommonButton, then using a switch to call static functions for init
and paintIcon
so that buttons are still broken up into different files.
Finished OnAllDesktop and KeepAbove, so the Window Buttons widget should work now.
Nice! Really nice to have new implementation for others to follow up. Do you have any idea how it would be the best way for buttons to provide width/height ratio? I can add it as a user setting in the applet but I would prefer a more automatic way.
Currently that theme does not support independent buttons drawing through KDecoration2 so Window Buttons Applet is not drawing anything. This is achieved through: https://github.com/KDE/breeze/blob/master/kdecoration/breezebutton.h#L48