Configurable notification window width (#42)
Co-authored-by: ErikReider <ereider20010103@gmail.com> Co-authored-by: ErikReider <ereider20010103@gmail.com> Co-authored-by: Erik Reider <35975961+ErikReider@users.noreply.github.com>
This commit is contained in:
@@ -92,6 +92,7 @@ To reload the config, you'll need to run `swaync-client --reload-config`
|
||||
- `keyboard-shortcuts`: `true` or `false`. If control center should use keyboard shortcuts
|
||||
- `image-visibility`: `always`, `when-available` or `never`. Notification image visiblilty
|
||||
- `transition-time`: uint (Any positive number, 0 to disable). The notification animation duration
|
||||
- `notification-window-width`: uint (Any positive number). Width of the notification in pixels
|
||||
|
||||
The main CSS style file is located in `/etc/xdg/swaync/style.css`. Copy it over to your `.config/swaync/` folder to customize without needing root access.
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
"timeout": 10,
|
||||
"timeout-low": 5,
|
||||
"timeout-critical": 0,
|
||||
"notification-window-width": 500,
|
||||
"keyboard-shortcuts": true,
|
||||
"image-visibility": "always",
|
||||
"transition-time": 200
|
||||
|
@@ -144,6 +144,11 @@ namespace SwayNotificatonCenter {
|
||||
default = ImageVisibility.ALWAYS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification window's width, in pixels.
|
||||
*/
|
||||
public int notification_window_width { get; set; default = 500; }
|
||||
|
||||
/* Methods */
|
||||
|
||||
/**
|
||||
|
@@ -6,7 +6,6 @@
|
||||
<property name="can-focus">False</property>
|
||||
<property name="role">NotificationWindow</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="default-width">500</property>
|
||||
<property name="type-hint">notification</property>
|
||||
<property name="skip-taskbar-hint">True</property>
|
||||
<property name="skip-pager-hint">True</property>
|
||||
|
@@ -44,6 +44,8 @@ namespace SwayNotificatonCenter {
|
||||
GtkLayerShell.set_layer (this, GtkLayerShell.Layer.OVERLAY);
|
||||
this.set_anchor ();
|
||||
viewport.size_allocate.connect (size_alloc);
|
||||
|
||||
this.default_width = ConfigModel.instance.notification_window_width;
|
||||
}
|
||||
|
||||
private void set_anchor () {
|
||||
|
@@ -15,12 +15,12 @@
|
||||
<object class="HdyCarousel" id="carousel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="allow-scroll-wheel">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
@@ -30,6 +30,7 @@
|
||||
<object class="GtkEventBox" id="event_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
|
Reference in New Issue
Block a user