diff options
author | tcmal <me@aria.rip> | 2024-06-09 17:34:45 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-06-09 17:34:45 +0100 |
commit | 124e6878b1de561f4bc3fccea768203821c88469 (patch) | |
tree | ff46ede6bc720148402841bfaad6d850ec900ab0 /src/colours.rs | |
parent | 66e3423828892a72e5e525f2dc8d5ad91e634445 (diff) |
minor cleanup
Diffstat (limited to 'src/colours.rs')
-rw-r--r-- | src/colours.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/colours.rs b/src/colours.rs index 6f862c3..bab92b6 100644 --- a/src/colours.rs +++ b/src/colours.rs @@ -4,14 +4,18 @@ use xcb::{ Connection, }; +/// Caches colours in an X11 color map. pub struct Colours { + #[allow(unused)] // Make sure the colour map we're using doesn't go anywhere cmap: Colormap, border_normal: u32, border_focused: u32, } impl Colours { + /// Load the colours into the given colour map pub fn new_with(conn: &Connection, cmap: Colormap) -> Result<Self> { + // TODO: Move these colours out to config.rs let (border_normal, border_focused) = ( conn.wait_for_reply(conn.send_request(&AllocColor { cmap, @@ -34,10 +38,12 @@ impl Colours { }) } + /// Get the pixel ID of the colour for an unfocused window's border. pub fn border_normal(&self) -> u32 { self.border_normal } + /// Get the pixel ID of the colour for a focused window's border. pub fn border_focused(&self) -> u32 { self.border_focused } |