diff --git a/docs/modules/Clock.md b/docs/modules/Clock.md index 627be83..a191763 100644 --- a/docs/modules/Clock.md +++ b/docs/modules/Clock.md @@ -8,12 +8,12 @@ Clicking on the widget opens a popup with the time and a calendar. > Type: `clock` -| Name | Type | Default | Description | -|----------------|----------|------------------------------------|-------------------------------------------------------------------------------------| -| `format` | `string` | `%d/%m/%Y %H:%M` | Date/time format string. Pango markup is supported. | -| `format_popup` | `string` | `%H:%M:%S` | Date/time format string to display in the popup header. Pango markup is supported. | -| `locale` | `string` | `$LC_TIME` or `$LANG` or `'POSIX'` | Locale to use (eg `en_GB`). Defaults to the system language (reading from env var). | -| `orientation` | `'horizontal'` or `'vertical'` (shorthand: `'h'` or `'v'`) | `'horizontal'` | Orientation of the time on the clock button. | +| Name | Type | Default | Description | +|----------------|------------------------------------------------------------|------------------------------------|-------------------------------------------------------------------------------------| +| `format` | `string` | `%d/%m/%Y %H:%M` | Date/time format string. Pango markup is supported. | +| `format_popup` | `string` | `%H:%M:%S` | Date/time format string to display in the popup header. Pango markup is supported. | +| `locale` | `string` | `$LC_TIME` or `$LANG` or `'POSIX'` | Locale to use (eg `en_GB`). Defaults to the system language (reading from env var). | +| `orientation` | `'horizontal'` or `'vertical'` (shorthand: `'h'` or `'v'`) | `'horizontal'` | Orientation of the time on the clock button. | > Detail on available tokens can be found here: diff --git a/docs/modules/Tray.md b/docs/modules/Tray.md index 9a90a45..e40dd04 100644 --- a/docs/modules/Tray.md +++ b/docs/modules/Tray.md @@ -6,11 +6,11 @@ Displays a fully interactive icon tray using the KDE `libappindicator` protocol. > Type: `tray` -| Name | Type | Default | Description | -|----------------------|-----------|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `direction` | `string` | `left_to_right` if bar is horizontal, `top_to_bottom` otherwise | Direction to display the tray items. Possible values: `top_to_bottom`, `bottom_to_top`, `left_to_right`, `right_to_left` | -| `icon_size` | `integer` | `16` | Size in pixels to display tray icons as. | -| `prefer_theme_icons` | `bool` | `true` | Requests that icons from the theme be used over the item-provided item. Most items only provide one or the other so this will have no effect in most circumstances. | +| Name | Type | Default | Description | +|----------------------|------------------------------------------------------------|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `orientation` | `'horizontal'` or `'vertical'` (shorthand: `'h'` or `'v'`) | Matches bar orientation | The direction in which to pack tray icons. | +| `icon_size` | `integer` | `16` | Size in pixels to display tray icons as. | +| `prefer_theme_icons` | `bool` | `true` | Requests that icons from the theme be used over the item-provided item. Most items only provide one or the other so this will have no effect in most circumstances. |
JSON diff --git a/src/modules/tray/interface.rs b/src/modules/tray/interface.rs index 0cd3930..472a41c 100644 --- a/src/modules/tray/interface.rs +++ b/src/modules/tray/interface.rs @@ -1,11 +1,13 @@ +use glib::Propagation; +use gtk::gdk::Gravity; use gtk::prelude::*; -use gtk::{Image, Label, MenuItem}; +use gtk::{EventBox, Image, Label, MenuItem}; use system_tray::item::{IconPixmap, StatusNotifierItem, Tooltip}; /// Main tray icon to show on the bar pub(crate) struct TrayMenu { + pub event_box: EventBox, pub widget: MenuItem, - menu_widget: Option, image_widget: Option, label_widget: Option