Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions shell/Ui/PanelActionButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ BorderSurface {
property color hoverColor: foreground
property string fontFamily: Style.font.family
property real fontSize: Style.font.icon
property real size: Math.max(Style.space(22), fontSize + Style.spacing.sm * 2)
// Whole and odd, so an icon glyph (usually an odd number of pixels wide)
// has the same space on both sides instead of one pixel more on one side.
property real size: Math.round(Math.max(Style.space(22), fontSize + Style.spacing.sm * 2)) | 1

property bool focusable: false
property bool hasCursor: false
Expand Down Expand Up @@ -71,7 +73,9 @@ BorderSurface {

Text {
textFormat: Text.PlainText
anchors.centerIn: parent
// Snap to whole pixels so the glyph doesn't round away from the fill's center.
x: Math.round((root.width - width) / 2)
y: Math.round((root.height - height) / 2)
text: root.iconText
color: root.enabled
? (root._hot ? root.hoverColor : root.foreground)
Expand Down
12 changes: 4 additions & 8 deletions shell/plugins/panels/network/Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1246,32 +1246,28 @@ Panel {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter

Button {
PanelActionButton {
id: qrAction
visible: root.canShareWifi
iconText: "󰐲"
tooltipText: "Show QR code"
foreground: root.bar.foreground
fontFamily: root.bar.fontFamily
iconSize: Style.font.subtitle * 1.5
horizontalPadding: Style.space(5)
verticalPadding: Style.space(2)
fontSize: Style.font.subtitle * 1.5
hasCursor: root.qrHeaderHasCursor
Layout.alignment: Qt.AlignVCenter
onHovered: function(on) { if (on) root.setHeaderCursor(root.qrHeaderIndex) }
onClicked: root.summonWifiQr()
}

Button {
PanelActionButton {
id: speedAction
visible: root.canRunSpeedTest
iconText: "󰓅"
tooltipText: "Run a speed test"
foreground: root.bar.foreground
fontFamily: root.bar.fontFamily
iconSize: Style.font.subtitle * 1.5
horizontalPadding: Style.space(5)
verticalPadding: Style.space(2)
fontSize: Style.font.subtitle * 1.5
hasCursor: root.speedHeaderHasCursor
Layout.alignment: Qt.AlignVCenter
onHovered: function(on) { if (on) root.setHeaderCursor(root.speedHeaderIndex) }
Expand Down