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 networkAuth = null;
|
||||
let networkAuthSSID = null;
|
||||
let passwordVisible = false;
|
||||
|
||||
const WifiNetwork = (accessPoint) => {
|
||||
const networkStrength = MaterialIcon(MATERIAL_SYMBOL_SIGNAL_STRENGTH[accessPoint.iconName], 'hugerass')
|
||||
@@ -171,6 +172,15 @@ const CurrentNetwork = () => {
|
||||
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({
|
||||
revealChild: false,
|
||||
child: Label({
|
||||
@@ -181,6 +191,7 @@ const CurrentNetwork = () => {
|
||||
const authEntry = Entry({
|
||||
className: 'sidebar-wifinetworks-auth-entry',
|
||||
visibility: false,
|
||||
hexpand: true,
|
||||
onAccept: (self) => {
|
||||
authLock = false;
|
||||
// Delete SSID connection before attempting to reconnect
|
||||
@@ -202,6 +213,14 @@ const CurrentNetwork = () => {
|
||||
},
|
||||
placeholderText: getString('Enter network password'),
|
||||
});
|
||||
const authBox = Box({
|
||||
className: 'spacing-h-5',
|
||||
vertical: false,
|
||||
children: [
|
||||
authEntry,
|
||||
authVisible,
|
||||
]
|
||||
});
|
||||
const forgetButton = Button({
|
||||
label: getString('Forget'),
|
||||
hexpand: true,
|
||||
@@ -270,7 +289,7 @@ const CurrentNetwork = () => {
|
||||
vertical: true,
|
||||
children: [
|
||||
authHeader,
|
||||
authEntry,
|
||||
authBox,
|
||||
authFailed,
|
||||
]
|
||||
}),
|
||||
@@ -291,7 +310,7 @@ const CurrentNetwork = () => {
|
||||
self.revealChild = false;
|
||||
authFailed.revealChild = false;
|
||||
Network.wifi.state = 'activated';
|
||||
}, 20000); // 20 seconds timeout
|
||||
}, 60000); // 60 seconds timeout
|
||||
}
|
||||
}
|
||||
).catch(print);
|
||||
|
||||
Reference in New Issue
Block a user