parent
eaecd0eec5
commit
7acb86fd98
3 changed files with 58 additions and 3 deletions
modules/ags/config/widgets/brightness-slider
35
modules/ags/config/widgets/brightness-slider/main.tsx
Normal file
35
modules/ags/config/widgets/brightness-slider/main.tsx
Normal file
|
@ -0,0 +1,35 @@
|
|||
import { bind } from 'astal';
|
||||
import { Astal, Gtk } from 'astal/gtk3';
|
||||
|
||||
import Brightness from '../../services/brightness';
|
||||
|
||||
import PopupWindow from '../misc/popup-window';
|
||||
|
||||
|
||||
export default () => {
|
||||
const brightness = Brightness.get_default();
|
||||
|
||||
return (
|
||||
<PopupWindow
|
||||
name="brightness-slider"
|
||||
anchor={Astal.WindowAnchor.RIGHT | Astal.WindowAnchor.TOP}
|
||||
>
|
||||
<box className="widget" widthRequest={500}>
|
||||
<slider
|
||||
hexpand
|
||||
halign={Gtk.Align.FILL}
|
||||
drawValue
|
||||
cursor="pointer"
|
||||
|
||||
min={0}
|
||||
max={100}
|
||||
|
||||
value={bind(brightness, 'screen').as((v) => v * 100)}
|
||||
onDragged={(self) => {
|
||||
brightness.screen = Number((self.value / 100).toFixed(2));
|
||||
}}
|
||||
/>
|
||||
</box>
|
||||
</PopupWindow>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue