Changeset View
Standalone View
applet/contents/ui/ConnectionItem.qml
Show All 14 Lines | 1 | /* | |||
---|---|---|---|---|---|
15 | Lesser General Public License for more details. | 15 | Lesser General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.2 | 21 | import QtQuick 2.2 | ||
22 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
23 | import QtQuick.Controls 2.4 as Controls | ||||
23 | import org.kde.kcoreaddons 1.0 as KCoreAddons | 24 | import org.kde.kcoreaddons 1.0 as KCoreAddons | ||
25 | import org.kde.kquickcontrolsaddons 2.0 | ||||
24 | import org.kde.plasma.components 2.0 as PlasmaComponents | 26 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
25 | import org.kde.plasma.core 2.0 as PlasmaCore | 27 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
26 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | 28 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | ||
27 | 29 | | |||
28 | PlasmaComponents.ListItem { | 30 | PlasmaComponents.ListItem { | ||
29 | id: connectionItem | 31 | id: connectionItem | ||
30 | 32 | | |||
31 | property bool activating: ConnectionState == PlasmaNM.Enums.Activating | 33 | property bool activating: ConnectionState == PlasmaNM.Enums.Activating | ||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 55 | ColumnLayout { | |||
132 | Loader { | 134 | Loader { | ||
133 | id: expandableComponentLoader | 135 | id: expandableComponentLoader | ||
134 | Layout.fillHeight: true | 136 | Layout.fillHeight: true | ||
135 | Layout.fillWidth: true | 137 | Layout.fillWidth: true | ||
136 | height: childrenRect.height | 138 | height: childrenRect.height | ||
137 | } | 139 | } | ||
138 | } | 140 | } | ||
139 | 141 | | |||
142 | MouseArea { | ||||
143 | acceptedButtons: Qt.RightButton | ||||
144 | anchors.fill: parent | ||||
broulik: What't this for? | |||||
I didn't want to interfere with other buttons/mouse actions/gestures. I tested without this and it looks like there's no issue. I took it out. vpilo: I didn't want to interfere with other buttons/mouse actions/gestures. I tested without this and… | |||||
145 | onPressed: { | ||||
146 | contextMenu.visualParent = parent | ||||
broulik: Context menus open on press, not click | |||||
147 | contextMenu.open() | ||||
Please pass the cursor position with it, the menu currently always opens in the top left corner rather than wherre the mouse is broulik: Please pass the cursor position with it, the menu currently always opens in the top left corner… | |||||
148 | } | ||||
149 | } | ||||
150 | | ||||
151 | PlasmaComponents.Menu { | ||||
I would prefer PlasmaComponent.Menu here which is a "proper" popping up menu rather than an inline item like QQC2 unfortunately always does. broulik: I would prefer `PlasmaComponent.Menu` here which is a "proper" popping up menu rather than an… | |||||
152 | id: contextMenu | ||||
153 | PlasmaComponents.MenuItem { | ||||
broulik: I don't think this header is needed, we hardly do that elsewhere. | |||||
I thought it made it easier when the wifi list changes to recognize if you clicked on the right item. Should I still take it away? vpilo: I thought it made it easier when the wifi list changes to recognize if you clicked on the right… | |||||
154 | text: ItemUniqueName | ||||
155 | enabled: false | ||||
156 | } | ||||
157 | PlasmaComponents.MenuItem { | ||||
158 | text: stateChangeButton.text | ||||
broulik: I guess you can just use the `stateChangeButton` text? | |||||
159 | icon: (ConnectionState == PlasmaNM.Enums.Deactivated) ? "network-connect" : "network-disconnect" | ||||
160 | onClicked: changeState() | ||||
161 | } | ||||
162 | PlasmaComponents.MenuItem { | ||||
163 | text: i18n("Configure") | ||||
164 | icon: "settings-configure" | ||||
165 | onClicked: KCMShell.open([mainWindow.kcm, "--args", "Uuid=" + Uuid]) | ||||
broulik: Sneaky, I didn't intend `KCMShell.open` to accept arbitrary argument :D | |||||
it's not a bug, it's a feature! Jokes aside, it can be pretty useful to give arguments to KCModules. vpilo: it's not a bug, it's a feature!
Jokes aside, it can be pretty useful to give arguments to… | |||||
166 | } | ||||
167 | } | ||||
168 | | ||||
140 | Component { | 169 | Component { | ||
141 | id: detailsComponent | 170 | id: detailsComponent | ||
142 | 171 | | |||
143 | Item { | 172 | Item { | ||
144 | height: childrenRect.height | 173 | height: childrenRect.height | ||
145 | 174 | | |||
146 | PlasmaComponents.TabBar { | 175 | PlasmaComponents.TabBar { | ||
147 | id: detailsTabBar | 176 | id: detailsTabBar | ||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |
What't this for?