Changeset View
Changeset View
Standalone View
Standalone View
applets/notes/package/contents/ui/main.qml
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 226 | anchors { | |||
---|---|---|---|---|---|
227 | bottom: parent.bottom | 227 | bottom: parent.bottom | ||
228 | left: parent.left | 228 | left: parent.left | ||
229 | right: parent.right | 229 | right: parent.right | ||
230 | leftMargin: horizontalMargins | 230 | leftMargin: horizontalMargins | ||
231 | rightMargin: horizontalMargins | 231 | rightMargin: horizontalMargins | ||
232 | bottomMargin: verticalMargins | 232 | bottomMargin: verticalMargins | ||
233 | } | 233 | } | ||
234 | 234 | | |||
235 | readonly property int requiredWidth: toggleFormatBarButton.width + formatButtonsRow.width + settingsButton.width + 3 * spacing | 235 | readonly property int requiredWidth: formatButtonsRow.width + spacing + settingsButton.width | ||
236 | readonly property bool showFormatButtons: width > requiredWidth | 236 | readonly property bool showFormatButtons: width > requiredWidth | ||
237 | 237 | | |||
238 | PlasmaComponents.ToolButton { | | |||
239 | id: toggleFormatBarButton | | |||
240 | tooltip: i18n("Toggle text format options") | | |||
241 | iconSource: "draw-text" | | |||
242 | checkable: true | | |||
243 | Accessible.name: tooltip | | |||
244 | visible: fontButtons.showFormatButtons | | |||
245 | } | | |||
246 | | ||||
247 | Row { | 238 | Row { | ||
davidedmundson: probably don't need this Row then, it's just there to make toggling easier? | |||||
248 | id: formatButtonsRow | 239 | id: formatButtonsRow | ||
249 | spacing: units.smallSpacing | 240 | spacing: units.smallSpacing | ||
250 | opacity: fontButtons.showFormatButtons && toggleFormatBarButton.checked ? 1 : 0 | 241 | // show format buttons if TextField or any of the buttons have focus | ||
242 | opacity: fontButtons.showFormatButtons && root.Plasmoid.activeFocus ? 1 : 0 | ||||
davidedmundson: just
root.Plasmoid.activeFoocus
after D6512 | |||||
251 | Behavior on opacity { NumberAnimation { duration: units.longDuration } } | 243 | Behavior on opacity { NumberAnimation { duration: units.longDuration } } | ||
252 | enabled: opacity > 0 | 244 | enabled: opacity > 0 | ||
253 | visible: fontButtons.showFormatButtons | 245 | visible: fontButtons.showFormatButtons | ||
254 | 246 | | |||
255 | PlasmaComponents.ToolButton { | 247 | PlasmaComponents.ToolButton { | ||
256 | tooltip: i18n("Bold") | 248 | tooltip: i18n("Bold") | ||
257 | iconSource: "format-text-bold" | 249 | iconSource: "format-text-bold" | ||
258 | checked: documentHandler.bold | 250 | checked: documentHandler.bold | ||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |
probably don't need this Row then, it's just there to make toggling easier?