Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar context button #605

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

Added:

- Dynamically select dark or light theme based on OS appearance. See [configuartion](https://halloy.squidowl.org/configuration/themes/index.html).
- Toggle channel topic with hotkey (<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>t</kbd> (macOS: <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>t</kbd>))
- Logging buffer to view logs. Can be opened via sidebar button or command bar.
- New hotkeys
- Toggle channel topic (<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>t</kbd> (macOS: <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>t</kbd>))
- Toggle file_transfers buffer (<kbd>Ctrl</kbd> + <kbd>j</kbd> (macOS: <kbd>⌘</kbd> + <kbd>j</kbd>))
- Toggle logs buffer (<kbd>Ctrl</kbd> + <kbd>l</kbd> (macOS: <kbd>⌘</kbd> + <kbd>l</kbd>))
- Toggle theme editor window (<kbd>Ctrl</kbd> + <kbd>t</kbd> (macOS: <kbd>⌘</kbd> + <kbd>t</kbd>))
- New configuration options
- Dynamically select dark or light theme based on OS appearance. See [configuartion](https://halloy.squidowl.org/configuration/themes/index.html).
- Ability to define a shell command for loading a NICKSERV password. See [configuration](https://halloy.squidowl.org/configuration/servers/index.html#nick_password_command)
- Ability to define a shell command for loading a SASL password. See [configuration](https://halloy.squidowl.org/configuration/servers/sasl/plain.html)
- Show/hide sidebar button to view logs. See [configuration](https://halloy.squidowl.org/configuration/sidebar/buttons.html#logs)
Expand All @@ -16,6 +20,11 @@ Fixed:
- Only highlight if user nick isn't part of another word.
- Errors from password commands are now caught and displayed to the user.

Removed:

- Configuration options:
- `[sidebar.buttons]` in favor for the new User Menu

# 2024.12 (2024-09-17)

Added:
Expand Down
18 changes: 18 additions & 0 deletions assets/fontello/config.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,24 @@
"css": "bucket",
"code": 59408,
"src": "entypo"
},
{
"uid": "559647a6f430b3aeadbecd67194451dd",
"css": "menu",
"code": 61641,
"src": "fontawesome"
},
{
"uid": "2c5335c6e56b876139d7a58ab2f4b2fe",
"css": "bell",
"code": 59409,
"src": "entypo"
},
{
"uid": "9755f76110ae4d12ac5f9466c9152031",
"css": "book",
"code": 59410,
"src": "fontawesome"
}
]
}
1 change: 0 additions & 1 deletion book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
- [Plain](configuration/servers/sasl/plain.md)
- [External](configuration/servers/sasl/external.md)
- [Sidebar](configuration/sidebar/README.md)
- [Buttons](configuration/sidebar/buttons.md)
- [Themes](configuration/themes/README.md)
- [Community](configuration/themes/community.md)
- [Tooltips](configuration/tooltips.md)
Expand Down
3 changes: 3 additions & 0 deletions book/src/configuration/keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ move_right = "alt+l"
| `toggle_sidebar` | Toggle sidebar | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>b</kbd> | <kbd>ctrl</kbd> + <kbd>alt</kbd> + <kbd>b</kbd> |
| `command_bar` | Toggle command bar | <kbd>⌘</kbd> + <kbd>k</kbd> | <kbd>ctrl</kbd> + <kbd>k</kbd> |
| `reload_configuration` | Refresh configuration file | <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>ctrl</kbd> + <kbd>r</kbd> |
| `file_transfers` | Toggle File Transfers Buffer | <kbd>⌘</kbd> + <kbd>j</kbd> | <kbd>ctrl</kbd> + <kbd>j</kbd> |
| `logs` | Toggle Logs Buffer | <kbd>⌘</kbd> + <kbd>l</kbd> | <kbd>ctrl</kbd> + <kbd>l</kbd> |
| `theme_editor` | Toggle Theme Editor Window | <kbd>⌘</kbd> + <kbd>t</kbd> | <kbd>ctrl</kbd> + <kbd>t</kbd> |
10 changes: 9 additions & 1 deletion book/src/configuration/sidebar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,12 @@ Specify sidebar width in pixels. Only used if `position` is `"left"` or `"right"

- **type**: integer
- **values**: any positive integer
- **default**: `120"`
- **default**: `120`

## `show_menu_button`

Show or hide the user menu button in the sidemenu.

- **type**: bool
- **values**: `true`, `false`
- **default**: `true`
54 changes: 0 additions & 54 deletions book/src/configuration/sidebar/buttons.md

This file was deleted.

8 changes: 5 additions & 3 deletions data/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::path::PathBuf;
use std::{string, str};
use std::{str, string};

use tokio_stream::wrappers::ReadDirStream;
use tokio_stream::StreamExt;
Expand Down Expand Up @@ -29,7 +29,7 @@ use crate::{environment, Theme};
pub mod buffer;
pub mod channel;
pub mod file_transfer;
mod keys;
pub mod keys;
pub mod notification;
pub mod proxy;
pub mod server;
Expand Down Expand Up @@ -169,7 +169,9 @@ impl Config {

let path = Self::path();
if !path.try_exists()? {
return Err(Error::ConfigMissing { has_yaml_config: has_yaml_config()? });
return Err(Error::ConfigMissing {
has_yaml_config: has_yaml_config()?,
});
}
let content = fs::read_to_string(path)
.await
Expand Down
12 changes: 12 additions & 0 deletions data/src/config/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ pub struct Keyboard {
pub command_bar: KeyBind,
#[serde(default = "KeyBind::reload_configuration")]
pub reload_configuration: KeyBind,
#[serde(default = "KeyBind::file_transfers")]
pub file_transfers: KeyBind,
#[serde(default = "KeyBind::logs")]
pub logs: KeyBind,
#[serde(default = "KeyBind::theme_editor")]
pub theme_editor: KeyBind,
}

impl Default for Keyboard {
Expand All @@ -54,6 +60,9 @@ impl Default for Keyboard {
toggle_topic: KeyBind::toggle_topic(),
command_bar: KeyBind::command_bar(),
reload_configuration: KeyBind::reload_configuration(),
file_transfers: KeyBind::file_transfers(),
logs: KeyBind::logs(),
theme_editor: KeyBind::theme_editor(),
}
}
}
Expand All @@ -78,6 +87,9 @@ impl Keyboard {
shortcut(self.toggle_sidebar.clone(), ToggleSidebar),
shortcut(self.command_bar.clone(), CommandBar),
shortcut(self.reload_configuration.clone(), ReloadConfiguration),
shortcut(self.file_transfers.clone(), FileTransfers),
shortcut(self.logs.clone(), Logs),
shortcut(self.theme_editor.clone(), ThemeEditor),
]
}
}
32 changes: 3 additions & 29 deletions data/src/config/sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ pub struct Sidebar {
#[serde(default = "default_sidebar_width")]
pub width: u16,
#[serde(default)]
pub buttons: Buttons,
#[serde(default)]
pub unread_indicator: UnreadIndicator,
#[serde(default)]
pub position: Position,
#[serde(default = "default_bool_true")]
pub show_user_menu: bool,
}

#[derive(Debug, Copy, Clone, Deserialize, Default)]
Expand Down Expand Up @@ -52,35 +52,9 @@ impl Default for Sidebar {
buffer_action: Default::default(),
buffer_focused_action: Default::default(),
width: default_sidebar_width(),
buttons: Default::default(),
unread_indicator: UnreadIndicator::default(),
position: Position::default(),
}
}
}

#[derive(Debug, Copy, Clone, Deserialize)]
pub struct Buttons {
#[serde(default = "default_bool_true")]
pub file_transfer: bool,
#[serde(default = "default_bool_true")]
pub command_bar: bool,
#[serde(default = "default_bool_true")]
pub reload_config: bool,
#[serde(default = "default_bool_true")]
pub theme_editor: bool,
#[serde(default = "default_bool_true")]
pub logs: bool,
}

impl Default for Buttons {
fn default() -> Self {
Buttons {
file_transfer: default_bool_true(),
command_bar: default_bool_true(),
reload_config: default_bool_true(),
theme_editor: default_bool_true(),
logs: default_bool_true(),
show_user_menu: default_bool_true(),
}
}
}
Expand Down
Loading
Loading