mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #1876 from notiant/patch-4
Adjust margins in BluetoothPanel & fix flickering issue in BluetoothSubTab
This commit is contained in:
@@ -27,7 +27,7 @@ SmartPanel {
|
||||
ColumnLayout {
|
||||
id: mainColumn
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginM
|
||||
anchors.margins: Style.marginL
|
||||
spacing: Style.marginM
|
||||
|
||||
// Header
|
||||
|
||||
@@ -114,7 +114,7 @@ SmartPanel {
|
||||
// Header
|
||||
NBox {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.round(header.implicitHeight + Style.marginM * 2 + 1)
|
||||
Layout.preferredHeight: header.implicitHeight + Style.marginXL
|
||||
|
||||
ColumnLayout {
|
||||
id: header
|
||||
@@ -274,7 +274,7 @@ SmartPanel {
|
||||
|
||||
ColumnLayout {
|
||||
id: contentColumn
|
||||
width: Math.round(contentScroll.availableWidth)
|
||||
width: contentScroll.availableWidth
|
||||
spacing: Style.marginM
|
||||
|
||||
// Wi‑Fi disabled state
|
||||
@@ -282,7 +282,7 @@ SmartPanel {
|
||||
id: disabledBox
|
||||
visible: panelViewMode === "wifi" && !Settings.data.network.wifiEnabled
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.round(disabledColumn.implicitHeight + Style.marginM * 2 + 1)
|
||||
Layout.preferredHeight: disabledColumn.implicitHeight + Style.marginXL
|
||||
|
||||
ColumnLayout {
|
||||
id: disabledColumn
|
||||
@@ -328,7 +328,7 @@ SmartPanel {
|
||||
id: scanningBox
|
||||
visible: panelViewMode === "wifi" && Settings.data.network.wifiEnabled && Object.keys(NetworkService.networks).length === 0 && NetworkService.scanning
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.round(scanningColumn.implicitHeight + Style.marginM * 2 + 1)
|
||||
Layout.preferredHeight: scanningColumn.implicitHeight + Style.marginXL
|
||||
|
||||
ColumnLayout {
|
||||
id: scanningColumn
|
||||
@@ -365,7 +365,7 @@ SmartPanel {
|
||||
id: emptyBox
|
||||
visible: panelViewMode === "wifi" && Settings.data.network.wifiEnabled && !NetworkService.scanning && Object.keys(NetworkService.networks).length === 0 && !NetworkService.scanning
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.round(emptyColumn.implicitHeight + Style.marginM * 2 + 1)
|
||||
Layout.preferredHeight: emptyColumn.implicitHeight + Style.marginXL
|
||||
|
||||
ColumnLayout {
|
||||
id: emptyColumn
|
||||
@@ -474,7 +474,7 @@ SmartPanel {
|
||||
NBox {
|
||||
visible: !(NetworkService.ethernetInterfaces && NetworkService.ethernetInterfaces.length > 0)
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.round(emptyEthColumn.implicitHeight + Style.marginM * 2 + 1)
|
||||
Layout.preferredHeight: emptyEthColumn.implicitHeight + Style.marginXL
|
||||
|
||||
ColumnLayout {
|
||||
id: emptyEthColumn
|
||||
@@ -521,7 +521,7 @@ SmartPanel {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Style.marginXS
|
||||
Layout.rightMargin: Style.marginXS
|
||||
implicitHeight: Math.round(ethItemColumn.implicitHeight + (Style.marginXL))
|
||||
implicitHeight: ethItemColumn.implicitHeight + Style.marginXL
|
||||
radius: Style.radiusM
|
||||
border.width: Style.borderS
|
||||
border.color: modelData.connected ? Color.mPrimary : Color.mOutline
|
||||
|
||||
@@ -48,7 +48,7 @@ NBox {
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.round(column.implicitHeight + Style.marginXL)
|
||||
Layout.preferredHeight: column.implicitHeight + Style.marginXL
|
||||
visible: root.model.length > 0
|
||||
|
||||
ColumnLayout {
|
||||
@@ -78,7 +78,7 @@ NBox {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Style.marginXS
|
||||
Layout.rightMargin: Style.marginXS
|
||||
implicitHeight: Math.round(netColumn.implicitHeight + (Style.marginXL))
|
||||
implicitHeight: netColumn.implicitHeight + Style.marginXL
|
||||
|
||||
opacity: (NetworkService.disconnectingFrom === modelData.ssid || NetworkService.forgettingNetwork === modelData.ssid) ? 0.6 : 1.0
|
||||
|
||||
@@ -154,8 +154,8 @@ NBox {
|
||||
visible: modelData.connected && NetworkService.disconnectingFrom !== modelData.ssid
|
||||
color: NetworkService.internetConnectivity ? Color.mPrimary : Color.mError
|
||||
radius: height * 0.5
|
||||
width: Math.round(connectedText.implicitWidth + (Style.marginS * 2))
|
||||
height: Math.round(connectedText.implicitHeight + (Style.marginXS))
|
||||
width: Math.round(connectedText.implicitWidth + Style.marginS * 2)
|
||||
height: Math.round(connectedText.implicitHeight + Style.marginXS)
|
||||
|
||||
NText {
|
||||
id: connectedText
|
||||
@@ -184,8 +184,8 @@ NBox {
|
||||
visible: NetworkService.disconnectingFrom === modelData.ssid
|
||||
color: Color.mError
|
||||
radius: height * 0.5
|
||||
width: Math.round(disconnectingText.implicitWidth + (Style.marginS * 2))
|
||||
height: Math.round(disconnectingText.implicitHeight + (Style.marginXS))
|
||||
width: Math.round(disconnectingText.implicitWidth + Style.marginS * 2)
|
||||
height: Math.round(disconnectingText.implicitHeight + Style.marginXS)
|
||||
|
||||
NText {
|
||||
id: disconnectingText
|
||||
@@ -200,8 +200,8 @@ NBox {
|
||||
visible: NetworkService.forgettingNetwork === modelData.ssid
|
||||
color: Color.mError
|
||||
radius: height * 0.5
|
||||
width: Math.round(forgettingText.implicitWidth + (Style.marginS * 2))
|
||||
height: Math.round(forgettingText.implicitHeight + (Style.marginXS))
|
||||
width: Math.round(forgettingText.implicitWidth + Style.marginS * 2)
|
||||
height: math.round(forgettingText.implicitHeight + Style.marginXS)
|
||||
|
||||
NText {
|
||||
id: forgettingText
|
||||
@@ -307,7 +307,7 @@ NBox {
|
||||
radius: Style.radiusS
|
||||
border.width: Style.borderS
|
||||
border.color: Color.mOutline
|
||||
implicitHeight: Math.round(infoGrid.implicitHeight + Style.marginS * 2)
|
||||
implicitHeight: infoGrid.implicitHeight + Style.marginS * 2
|
||||
clip: true
|
||||
onVisibleChanged: {
|
||||
if (visible && infoGrid && infoGrid.forceLayout) {
|
||||
|
||||
@@ -113,10 +113,10 @@ Item {
|
||||
}
|
||||
} else {
|
||||
Logger.d("BluetoothPrefs", "Panel/tab inactive");
|
||||
if (isScanningActive) {
|
||||
if (isScanningActive && !showOnlyLists) {
|
||||
BluetoothService.setScanActive(false);
|
||||
}
|
||||
if (isDiscoverable) {
|
||||
if (isDiscoverable && !showOnlyLists) {
|
||||
BluetoothService.setDiscoverable(false);
|
||||
}
|
||||
}
|
||||
@@ -124,11 +124,11 @@ Item {
|
||||
|
||||
Component.onDestruction: {
|
||||
// Ensure scanning is stopped when component is closed
|
||||
if (isScanningActive) {
|
||||
if (isScanningActive && !showOnlyLists) {
|
||||
BluetoothService.setScanActive(false);
|
||||
}
|
||||
// Ensure discoverable is disabled when component is closed
|
||||
if (isDiscoverable) {
|
||||
if (isDiscoverable && !showOnlyLists) {
|
||||
BluetoothService.setDiscoverable(false);
|
||||
}
|
||||
Logger.d("BluetoothPrefs", "Panel closed");
|
||||
@@ -204,8 +204,8 @@ Item {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: Style.marginM
|
||||
anchors.bottomMargin: Style.marginM
|
||||
anchors.leftMargin: showOnlyLists ? Style.marginM : 0
|
||||
anchors.rightMargin: showOnlyLists ? Style.marginM : 0
|
||||
anchors.leftMargin: showOnlyLists ? Style.marginL : 0
|
||||
anchors.rightMargin: showOnlyLists ? Style.marginL : 0
|
||||
spacing: Style.marginM
|
||||
|
||||
NLabel {
|
||||
@@ -234,8 +234,8 @@ Item {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: Style.marginM
|
||||
anchors.bottomMargin: Style.marginM
|
||||
anchors.leftMargin: showOnlyLists ? Style.marginM : 0
|
||||
anchors.rightMargin: showOnlyLists ? Style.marginM : 0
|
||||
anchors.leftMargin: showOnlyLists ? Style.marginL : 0
|
||||
anchors.rightMargin: showOnlyLists ? Style.marginL : 0
|
||||
spacing: Style.marginM
|
||||
|
||||
NLabel {
|
||||
@@ -264,8 +264,6 @@ Item {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: Style.marginM
|
||||
anchors.bottomMargin: Style.marginM
|
||||
anchors.leftMargin: showOnlyLists ? Style.marginM : 0
|
||||
anchors.rightMargin: showOnlyLists ? Style.marginM : 0
|
||||
spacing: Style.marginM
|
||||
|
||||
RowLayout {
|
||||
|
||||
@@ -338,9 +338,8 @@ Singleton {
|
||||
if (adapter) {
|
||||
adapter.enabled = state;
|
||||
} else {
|
||||
btExec(["bluetoothctl", "power", state ? "on" : "off"]);
|
||||
root.ctlPowered = state;
|
||||
requestCtlPoll(ctlPollSoonMs);
|
||||
btExec(["bluetoothctl", "power", state ? "on" : "off"]);
|
||||
ToastService.showNotice(I18n.tr("common.bluetooth"), state ? I18n.tr("common.enabled") : I18n.tr("common.disabled"), state ? "bluetooth" : "bluetooth-off");
|
||||
Logger.d("Bluetooth", state ? "Adapter enabled" : "Adapter disabled");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user