lxqt / lxqt-notificationd

The LXQt notification daemon
https://lxqt.github.io
GNU Lesser General Public License v2.1
62 stars 38 forks source link

Toggle "Do not disturb" from tray #289

Closed stefonarch closed 2 months ago

stefonarch commented 2 years ago

Actually we have "Basic Settings" and "advanced". When clicking "Settings" in the tray icon (if unattended notifications is active) users arrive at the position setting, the have to switch to "advanced" to change settings.

schermata-12-14-09-02

tsujan commented 2 years ago

I agree.

stefonarch commented 2 years ago

Actually I'm not fully satisfied yet: When changing size and spacing users have to switch always between "General" and "Position" to have a preview.

So logically there should be "General Settings" and "Appearance and Position"; the latter should contain Size, Spazing and "show on screen with mouse cursor":

tsujan commented 2 years ago

Personally, I have no problem with the changes you suggested. They just need time. Since rearranging the code may introduce new bugs, it should be done with more care; otherwise, there's no obstacle.

stefonarch commented 1 year ago

Stumbled open this, forgot it. Instead of a new issue I make a note here: "Do not disturb" is away some clicks, could there be an option in the tray menu to toggle it?

tsujan commented 1 year ago

could there be an option in the tray menu to toggle it?

It should be possible — although I don't remember the code ;)

BTW, we changed the layout; didn't we? Why is this still open?

tsujan commented 1 year ago

Oh, sorry, I didn't notice that you re-opened it because of your new suggestion.

stefonarch commented 1 year ago

Happened the same to me, why is that open still? ;)

tsujan commented 1 year ago

Changed the title.

stefonarch commented 1 year ago

This is quite messy now to understand, as it's partially achieved and the title has changed as it's about an enhancement (toggle "do not disturb" from systray). I edited the first post.

stefonarch commented 1 year ago

I managed to get the item in the right click menu but not the action as m_area is not declared here and it should toggle "do not disturb", being a checkbox. https://github.com/lxqt/lxqt-notificationd/blob/63fdeb192b8e7bf0a131278393903de0b014e0cd/src/notifyd.cpp#L266

    // "Do not disturb"
    action = m_trayMenu->addAction(QIcon::fromTheme(QSL("notifications-disabled")), tr("Do not disturb"));
   // connect(action, &QAction::triggered, m_trayMenu, [] {
   // m_area->layout()->setDoNotDisturb(m_doNotDisturb);)}

   // "Options"
    action = m_trayMenu->addAction(QIcon::fromTheme(QSL("preferences-system")), tr("Options"));
    connect(action, &QAction::triggered, m_trayMenu, [] {
        QProcess::startDetached(QSL("lxqt-config-notificationd"), QStringList());
    });