forked from Shinonome/dots-hyprland
wifinetworks:add show password button
This commit is contained in:
@@ -19,6 +19,7 @@ const MATERIAL_SYMBOL_SIGNAL_STRENGTH = {
|
|||||||
let connectAttempt = '';
|
let connectAttempt = '';
|
||||||
let networkAuth = null;
|
let networkAuth = null;
|
||||||
let networkAuthSSID = null;
|
let networkAuthSSID = null;
|
||||||
|
let passwordVisible = false;
|
||||||
|
|
||||||
const WifiNetwork = (accessPoint) => {
|
const WifiNetwork = (accessPoint) => {
|
||||||
const networkStrength = MaterialIcon(MATERIAL_SYMBOL_SIGNAL_STRENGTH[accessPoint.iconName], 'hugerass')
|
const networkStrength = MaterialIcon(MATERIAL_SYMBOL_SIGNAL_STRENGTH[accessPoint.iconName], 'hugerass')
|
||||||
@@ -171,6 +172,15 @@ const CurrentNetwork = () => {
|
|||||||
cancelAuthButton
|
cancelAuthButton
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
const authVisible = Button({
|
||||||
|
child: MaterialIcon('visibility', 'large'),
|
||||||
|
className: 'txt sidebar-wifinetworks-auth-visible',
|
||||||
|
onClicked: () => {
|
||||||
|
passwordVisible = !passwordVisible;
|
||||||
|
authEntry.visibility = passwordVisible;
|
||||||
|
},
|
||||||
|
setup: setupCursorHover,
|
||||||
|
});
|
||||||
const authFailed = Revealer({
|
const authFailed = Revealer({
|
||||||
revealChild: false,
|
revealChild: false,
|
||||||
child: Label({
|
child: Label({
|
||||||
@@ -181,6 +191,7 @@ const CurrentNetwork = () => {
|
|||||||
const authEntry = Entry({
|
const authEntry = Entry({
|
||||||
className: 'sidebar-wifinetworks-auth-entry',
|
className: 'sidebar-wifinetworks-auth-entry',
|
||||||
visibility: false,
|
visibility: false,
|
||||||
|
hexpand: true,
|
||||||
onAccept: (self) => {
|
onAccept: (self) => {
|
||||||
authLock = false;
|
authLock = false;
|
||||||
// Delete SSID connection before attempting to reconnect
|
// Delete SSID connection before attempting to reconnect
|
||||||
@@ -202,6 +213,14 @@ const CurrentNetwork = () => {
|
|||||||
},
|
},
|
||||||
placeholderText: getString('Enter network password'),
|
placeholderText: getString('Enter network password'),
|
||||||
});
|
});
|
||||||
|
const authBox = Box({
|
||||||
|
className: 'spacing-h-5',
|
||||||
|
vertical: false,
|
||||||
|
children: [
|
||||||
|
authEntry,
|
||||||
|
authVisible,
|
||||||
|
]
|
||||||
|
});
|
||||||
const forgetButton = Button({
|
const forgetButton = Button({
|
||||||
label: getString('Forget'),
|
label: getString('Forget'),
|
||||||
hexpand: true,
|
hexpand: true,
|
||||||
@@ -270,7 +289,7 @@ const CurrentNetwork = () => {
|
|||||||
vertical: true,
|
vertical: true,
|
||||||
children: [
|
children: [
|
||||||
authHeader,
|
authHeader,
|
||||||
authEntry,
|
authBox,
|
||||||
authFailed,
|
authFailed,
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
@@ -291,7 +310,7 @@ const CurrentNetwork = () => {
|
|||||||
self.revealChild = false;
|
self.revealChild = false;
|
||||||
authFailed.revealChild = false;
|
authFailed.revealChild = false;
|
||||||
Network.wifi.state = 'activated';
|
Network.wifi.state = 'activated';
|
||||||
}, 20000); // 20 seconds timeout
|
}, 60000); // 60 seconds timeout
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
).catch(print);
|
).catch(print);
|
||||||
|
|||||||
@@ -1007,13 +1007,27 @@ $waifu_image_overlay_transparency: 0.7;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-wifinetworks-auth-entry {
|
.sidebar-wifinetworks-auth-entry {
|
||||||
@include small-rounding;
|
border-radius: 12px 0px 0px 12px;
|
||||||
background-color: $layer1;
|
background-color: $layer1;
|
||||||
color: $onLayer1;
|
color: $onLayer1;
|
||||||
padding: 0.682rem;
|
padding: 0.682rem;
|
||||||
caret-color: $onLayer2;
|
caret-color: $onLayer2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-wifinetworks-auth-visible {
|
||||||
|
@include element_decel;
|
||||||
|
border-radius: 0px 12px 12px 0px;
|
||||||
|
background-color: $layer2Hover;
|
||||||
|
color: $onLayer2;
|
||||||
|
padding: 0.682rem;
|
||||||
|
min-width: 0.918rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-wifinetworks-auth-visible:hover,
|
||||||
|
.sidebar-wifinetworks-auth-visible:focus {
|
||||||
|
background-color: $layer2Active;
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar-wifinetworks-bandwidth {
|
.sidebar-wifinetworks-bandwidth {
|
||||||
min-width: 6.3rem;
|
min-width: 6.3rem;
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user