SwayNotificationCenter icon indicating copy to clipboard operation
SwayNotificationCenter copied to clipboard

Add `"notification-window-height"`

Open NotAShelf opened this issue 2 years ago • 7 comments

I think the title is self-explanatory. Found it funny how an option to configure width exists, but height doesn't.

NotAShelf avatar Oct 15 '22 22:10 NotAShelf

Unless I am missing this config option entirely, it would be pretty much appreciated if this could be added.

NotAShelf avatar Oct 15 '22 22:10 NotAShelf

Update: I've just noticed your notice in the README, apologies if this comes out as pushy. That was not my intention.

I've decided to take the matters into my hand and attempted adding in the feature myself, but after editing the source code and building manually, the height option is ignored. Which leads me to believe this is a technical limitation. Unless, of course, I am missing something. Which is likely.

I've added

config.json.in

  "notification-window-height": 350,

configSchema.json

 "notification-window-height": {
      "type": "integer",
      "description": "Height of the notification in pixels",
      "default": 350
    },

configModel.vala

     /**
         * Notification window's height, in pixels.
         */
        public int notification_window_height { get; set; default = 350; }

and finally

notificationWindow.vala

this.default_height = ConfigModel.instance.notification_window_height;

NotAShelf avatar Oct 15 '22 22:10 NotAShelf

I did my best to implement it the same way as width parameter was implemented, but can't find anywhere else that width was referenced. Am I missing anything specific?

NotAShelf avatar Oct 15 '22 22:10 NotAShelf

No worries! :)

If I remember correctly, there should be a constant called MAX_HEIGHT that's used

ErikReider avatar Oct 16 '22 09:10 ErikReider

Hm, yes there is a MAX_HEIGHT constant in src/notificationWindow/notificationWindow.vala. I'll do further testing later today.

NotAShelf avatar Oct 16 '22 10:10 NotAShelf

Unfortunately I was unable to get a working prototype. I'm not giving up yet, but probably won't be able to implement what I want anytime soon. Feel free to close this issue.

NotAShelf avatar Oct 17 '22 19:10 NotAShelf

Hmm. I have a faint memory of trying to implement this earlier but decided not to. I wonder why... The PR was #38

I'll leave this open for the time being

ErikReider avatar Oct 17 '22 20:10 ErikReider