Changeset View
Changeset View
Standalone View
Standalone View
applets/konsoleprofiles/package/contents/ui/konsoleprofiles.qml
Show All 24 Lines | 24 | Item { | |||
---|---|---|---|---|---|
25 | id: konsoleProfiles | 25 | id: konsoleProfiles | ||
26 | 26 | | |||
27 | Plasmoid.switchWidth: units.gridUnit * 11 | 27 | Plasmoid.switchWidth: units.gridUnit * 11 | ||
28 | Plasmoid.switchHeight: units.gridUnit * 11 | 28 | Plasmoid.switchHeight: units.gridUnit * 11 | ||
29 | 29 | | |||
30 | Layout.minimumWidth: units.gridUnit * 12 | 30 | Layout.minimumWidth: units.gridUnit * 12 | ||
31 | Layout.minimumHeight: units.gridUnit * 12 | 31 | Layout.minimumHeight: units.gridUnit * 12 | ||
32 | 32 | | |||
33 | function popupEventSlot(shown) { | 33 | Plasmoid.onExpandedChanged: { | ||
34 | if (shown) { | 34 | if (plasmoid.expanded) { | ||
35 | view.forceActiveFocus(); | 35 | view.forceActiveFocus(); | ||
36 | } | 36 | } | ||
37 | } | 37 | } | ||
38 | 38 | | |||
39 | PlasmaCore.DataSource { | 39 | PlasmaCore.DataSource { | ||
40 | id: profilesSource | 40 | id: profilesSource | ||
41 | engine: "org.kde.konsoleprofiles" | 41 | engine: "org.kde.konsoleprofiles" | ||
42 | onSourceAdded: connectSource(source) | 42 | onSourceAdded: connectSource(source) | ||
43 | onSourceRemoved: disconnectSource(source) | 43 | onSourceRemoved: disconnectSource(source) | ||
44 | 44 | | |||
45 | Component.onCompleted: connectedSources = sources | 45 | Component.onCompleted: connectedSources = sources | ||
46 | } | 46 | } | ||
47 | 47 | | |||
48 | PlasmaCore.SortFilterModel { | 48 | PlasmaCore.SortFilterModel { | ||
49 | id: profilesModel | 49 | id: profilesModel | ||
50 | sortRole: "prettyName" | 50 | sortRole: "prettyName" | ||
51 | sortOrder: "AscendingOrder" | 51 | sortOrder: "AscendingOrder" | ||
52 | sourceModel: PlasmaCore.DataModel { | 52 | sourceModel: PlasmaCore.DataModel { | ||
53 | dataSource: profilesSource | 53 | dataSource: profilesSource | ||
54 | } | 54 | } | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | Component.onCompleted: { | 57 | Component.onCompleted: { | ||
58 | plasmoid.popupIcon = "utilities-terminal"; | 58 | plasmoid.popupIcon = "utilities-terminal"; | ||
59 | plasmoid.popupEvent.connect('popupEvent', popupEventSlot); | | |||
60 | } | 59 | } | ||
61 | 60 | | |||
62 | PlasmaCore.Svg { | 61 | PlasmaCore.Svg { | ||
63 | id: lineSvg | 62 | id: lineSvg | ||
64 | imagePath: "widgets/line" | 63 | imagePath: "widgets/line" | ||
65 | } | 64 | } | ||
66 | 65 | | |||
67 | Row { | 66 | Row { | ||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |