Changeset View
Changeset View
Standalone View
Standalone View
applets/notes/package/contents/ui/main.qml
Show All 36 Lines | |||||
37 | PlasmaCore.SvgItem { | 37 | PlasmaCore.SvgItem { | ||
38 | id: root | 38 | id: root | ||
39 | 39 | | |||
40 | svg: PlasmaCore.Svg { | 40 | svg: PlasmaCore.Svg { | ||
41 | imagePath: "widgets/notes" | 41 | imagePath: "widgets/notes" | ||
42 | } | 42 | } | ||
43 | elementId: plasmoid.configuration.color + "-notes" | 43 | elementId: plasmoid.configuration.color + "-notes" | ||
44 | 44 | | |||
45 | width: units.gridUnit * 14 | 45 | width: units.gridUnit * 15 | ||
46 | height: units.gridUnit * 14 | 46 | height: units.gridUnit * 15 | ||
47 | Layout.minimumWidth: units.iconSizes.medium | 47 | Layout.minimumWidth: units.iconSizes.medium | ||
48 | Layout.minimumHeight: units.iconSizes.medium | 48 | Layout.minimumHeight: units.iconSizes.medium | ||
49 | Plasmoid.switchWidth: units.gridUnit * 5 | 49 | Plasmoid.switchWidth: units.gridUnit * 5 | ||
50 | Plasmoid.switchHeight: units.gridUnit * 5 | 50 | Plasmoid.switchHeight: units.gridUnit * 5 | ||
51 | 51 | | |||
52 | Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground | 52 | Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground | ||
53 | 53 | | |||
54 | // this isn't a frameSVG, the default SVG margins take up around 7% of the frame size, so we use that | 54 | // this isn't a frameSVG, the default SVG margins take up around 7% of the frame size, so we use that | ||
▲ Show 20 Lines • Show All 298 Lines • ▼ Show 20 Line(s) | 352 | anchors { | |||
353 | bottom: parent.bottom | 353 | bottom: parent.bottom | ||
354 | left: parent.left | 354 | left: parent.left | ||
355 | right: parent.right | 355 | right: parent.right | ||
356 | } | 356 | } | ||
357 | 357 | | |||
358 | opacity: focusScope.activeFocus ? 1 : 0 | 358 | opacity: focusScope.activeFocus ? 1 : 0 | ||
359 | Behavior on opacity { NumberAnimation { duration: units.longDuration } } | 359 | Behavior on opacity { NumberAnimation { duration: units.longDuration } } | ||
360 | 360 | | |||
361 | readonly property int requiredWidth: formatButtonsRow.width + spacing + settingsButton.width | 361 | readonly property int requiredWidth: formatButtonsRow.width + spacing + settingsButton.width + removeButton.width | ||
362 | readonly property bool showFormatButtons: width > requiredWidth | 362 | readonly property bool showFormatButtons: width > requiredWidth | ||
363 | 363 | | |||
364 | Row { | 364 | Row { | ||
365 | id: formatButtonsRow | 365 | id: formatButtonsRow | ||
366 | spacing: units.smallSpacing | 366 | spacing: units.smallSpacing | ||
367 | // show format buttons if TextField or any of the buttons have focus | 367 | // show format buttons if TextField or any of the buttons have focus | ||
368 | enabled: opacity > 0 | 368 | enabled: opacity > 0 | ||
369 | visible: fontButtons.showFormatButtons | 369 | visible: fontButtons.showFormatButtons | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 430 | QQC2.ToolButton { | |||
435 | icon.height: icon.width | 435 | icon.height: icon.width | ||
436 | onClicked: plasmoid.action("configure").trigger() | 436 | onClicked: plasmoid.action("configure").trigger() | ||
437 | Accessible.name: settingsTooltip.text | 437 | Accessible.name: settingsTooltip.text | ||
438 | QQC2.ToolTip { | 438 | QQC2.ToolTip { | ||
439 | id: settingsTooltip | 439 | id: settingsTooltip | ||
440 | text: plasmoid.action("configure").text | 440 | text: plasmoid.action("configure").text | ||
441 | } | 441 | } | ||
442 | } | 442 | } | ||
443 | | ||||
444 | QQC2.ToolButton { | ||||
445 | id: removeButton | ||||
446 | icon.name: "edit-delete" | ||||
447 | icon.color: textIconColor | ||||
448 | icon.width: units.iconSizes.smallMedium | ||||
449 | icon.height: icon.width | ||||
450 | onClicked: plasmoid.action("remove").trigger() | ||||
451 | Accessible.name: removeTooltip.text | ||||
452 | QQC2.ToolTip { | ||||
453 | id: removeTooltip | ||||
454 | text: plasmoid.action("remove").text | ||||
455 | } | ||||
456 | } | ||||
443 | } | 457 | } | ||
444 | } | 458 | } | ||
445 | 459 | | |||
446 | Component.onCompleted: { | 460 | Component.onCompleted: { | ||
447 | plasmoid.setAction("change_note_color_white", i18nc("@item:inmenu", "White")); | 461 | plasmoid.setAction("change_note_color_white", i18nc("@item:inmenu", "White")); | ||
448 | plasmoid.setAction("change_note_color_black", i18nc("@item:inmenu", "Black")); | 462 | plasmoid.setAction("change_note_color_black", i18nc("@item:inmenu", "Black")); | ||
449 | plasmoid.setAction("change_note_color_red", i18nc("@item:inmenu", "Red")); | 463 | plasmoid.setAction("change_note_color_red", i18nc("@item:inmenu", "Red")); | ||
450 | plasmoid.setAction("change_note_color_orange", i18nc("@item:inmenu", "Orange")); | 464 | plasmoid.setAction("change_note_color_orange", i18nc("@item:inmenu", "Orange")); | ||
Show All 25 Lines |