Commit 4c2f9a61 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Notes Applet] Show formatting options when it has focus

This is a lot less cumbersome than manually toggling the formatting button.
It ensures clean looks when the applet is not being edited while making it
more prominent to the user that there is actually formatting available.

Differential Revision:
parent 8629becd
......@@ -232,22 +232,14 @@ PlasmaCore.SvgItem {
bottomMargin: verticalMargins
readonly property int requiredWidth: toggleFormatBarButton.width + formatButtonsRow.width + settingsButton.width + 3 * spacing
readonly property int requiredWidth: formatButtonsRow.width + spacing + settingsButton.width
readonly property bool showFormatButtons: width > requiredWidth
PlasmaComponents.ToolButton {
id: toggleFormatBarButton
tooltip: i18n("Toggle text format options")
iconSource: "draw-text"
checkable: true tooltip
visible: fontButtons.showFormatButtons
Row {
id: formatButtonsRow
spacing: units.smallSpacing
opacity: fontButtons.showFormatButtons && toggleFormatBarButton.checked ? 1 : 0
// show format buttons if TextField or any of the buttons have focus
opacity: fontButtons.showFormatButtons && root.Plasmoid.activeFocus ? 1 : 0
Behavior on opacity { NumberAnimation { duration: units.longDuration } }
enabled: opacity > 0
visible: fontButtons.showFormatButtons
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment