Changeset View
Changeset View
Standalone View
Standalone View
containments/panel/contents/ui/ConfigOverlay.qml
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Line(s) | 350 | PlasmaCore.Dialog { | |||
---|---|---|---|---|---|
355 | flags: Qt.WindowStaysOnTopHint|Qt.WindowDoesNotAcceptFocus|Qt.BypassWindowManagerHint | 355 | flags: Qt.WindowStaysOnTopHint|Qt.WindowDoesNotAcceptFocus|Qt.BypassWindowManagerHint | ||
356 | location: plasmoid.location | 356 | location: plasmoid.location | ||
357 | 357 | | |||
358 | onVisualParentChanged: { | 358 | onVisualParentChanged: { | ||
359 | if (visualParent) { | 359 | if (visualParent) { | ||
360 | currentApplet.applet.prepareContextualActions(); | 360 | currentApplet.applet.prepareContextualActions(); | ||
361 | alternativesButton.visible = currentApplet.applet.action("alternatives") && currentApplet.applet.action("alternatives").enabled; | 361 | alternativesButton.visible = currentApplet.applet.action("alternatives") && currentApplet.applet.action("alternatives").enabled; | ||
362 | configureButton.visible = currentApplet.applet.action("configure") && currentApplet.applet.action("configure").enabled; | 362 | configureButton.visible = currentApplet.applet.action("configure") && currentApplet.applet.action("configure").enabled; | ||
363 | closeButton.visible = currentApplet.applet.action("remove") && currentApplet.applet.action("remove").enabled; | | |||
364 | label.text = currentApplet.applet.title; | 363 | label.text = currentApplet.applet.title; | ||
365 | } | 364 | } | ||
366 | } | 365 | } | ||
367 | 366 | | |||
368 | mainItem: MouseArea { | 367 | mainItem: MouseArea { | ||
369 | enabled: currentApplet | 368 | enabled: currentApplet | ||
370 | width: handleButtons.width | 369 | width: handleButtons.width | ||
371 | height: handleButtons.height | 370 | height: handleButtons.height | ||
372 | hoverEnabled: true | 371 | hoverEnabled: true | ||
373 | onEntered: hideTimer.stop(); | 372 | onEntered: hideTimer.stop(); | ||
374 | onExited: hideTimer.restart(); | 373 | onExited: hideTimer.restart(); | ||
375 | 374 | | |||
376 | ColumnLayout { | 375 | ColumnLayout { | ||
377 | id: handleButtons | 376 | id: handleButtons | ||
378 | spacing: units.smallSpacing | 377 | spacing: units.smallSpacing | ||
379 | 378 | | |||
380 | PlasmaExtras.Heading { | 379 | PlasmaExtras.Heading { | ||
381 | id: label | 380 | id: label | ||
382 | level: 3 | 381 | level: 3 | ||
383 | Layout.fillWidth: true | 382 | Layout.fillWidth: true | ||
384 | Layout.leftMargin: units.smallSpacing * 2 | 383 | Layout.leftMargin: units.smallSpacing * 2 | ||
385 | Layout.rightMargin: units.smallSpacing * 2 | 384 | Layout.rightMargin: units.smallSpacing * 2 | ||
386 | } | 385 | } | ||
387 | PlasmaComponents.ToolButton { | 386 | PlasmaComponents.ToolButton { | ||
387 | Layout.fillWidth: true | ||||
388 | // we want destructive actions to be far from the initial | ||||
389 | // cursor position, so show this on the top unless it's on | ||||
390 | // a top panel | ||||
391 | visible: tooltip.location !== PlasmaCore.Types.TopEdge | ||||
392 | && currentApplet.applet.action("remove") | ||||
393 | && currentApplet.applet.action("remove").enabled | ||||
394 | iconSource: "delete" | ||||
395 | text: i18n("Remove") | ||||
396 | onClicked: { | ||||
397 | tooltip.visible = false; | ||||
398 | currentApplet.applet.action("remove").trigger(); | ||||
399 | } | ||||
400 | } | ||||
401 | PlasmaComponents.ToolButton { | ||||
388 | id: configureButton | 402 | id: configureButton | ||
389 | Layout.fillWidth: true | 403 | Layout.fillWidth: true | ||
390 | iconSource: "configure" | 404 | iconSource: "configure" | ||
391 | text: i18n("Configure...") | 405 | text: i18n("Configure...") | ||
392 | onClicked: { | 406 | onClicked: { | ||
393 | tooltip.visible = false; | 407 | tooltip.visible = false; | ||
394 | currentApplet.applet.action("configure").trigger() | 408 | currentApplet.applet.action("configure").trigger() | ||
395 | } | 409 | } | ||
396 | } | 410 | } | ||
397 | PlasmaComponents.ToolButton { | 411 | PlasmaComponents.ToolButton { | ||
398 | id: alternativesButton | 412 | id: alternativesButton | ||
399 | Layout.fillWidth: true | 413 | Layout.fillWidth: true | ||
400 | iconSource: "widget-alternatives" | 414 | iconSource: "widget-alternatives" | ||
401 | text: i18n("Show Alternatives...") | 415 | text: i18n("Show Alternatives...") | ||
402 | onClicked: { | 416 | onClicked: { | ||
403 | tooltip.visible = false; | 417 | tooltip.visible = false; | ||
404 | currentApplet.applet.action("alternatives").trigger() | 418 | currentApplet.applet.action("alternatives").trigger() | ||
405 | } | 419 | } | ||
406 | } | 420 | } | ||
407 | PlasmaComponents.ToolButton { | 421 | PlasmaComponents.ToolButton { | ||
408 | id: closeButton | | |||
409 | Layout.fillWidth: true | 422 | Layout.fillWidth: true | ||
423 | // we want destructive actions to be far from the initial | ||||
424 | // cursor position, so show this on the bottom for top panels | ||||
425 | visible: tooltip.location === PlasmaCore.Types.TopEdge | ||||
426 | && currentApplet.applet.action("remove") | ||||
427 | && currentApplet.applet.action("remove").enabled | ||||
410 | iconSource: "delete" | 428 | iconSource: "delete" | ||
411 | text: i18n("Remove") | 429 | text: i18n("Remove") | ||
412 | onClicked: { | 430 | onClicked: { | ||
413 | tooltip.visible = false; | 431 | tooltip.visible = false; | ||
414 | currentApplet.applet.action("remove").trigger(); | 432 | currentApplet.applet.action("remove").trigger(); | ||
415 | } | 433 | } | ||
416 | } | 434 | } | ||
417 | } | 435 | } | ||
418 | } | 436 | } | ||
419 | } | 437 | } | ||
420 | } | 438 | } |