applets/digital-clock: add inverted option to clipboard menu

This commit adds a new option to the "Copy to Clipboard" menu that
shows the date with seconds when "show seconds" is not enabled and
without seconds when "show seconds" is enabled.

BUG: 453111
wilder-5.25
Felipe Kinoshita 4 years ago
parent 13c6cb3a21
commit 68ea72876c
No known key found for this signature in database
GPG Key ID: E5FF0D0C1A82B6A1
  1. 6
      applets/digital-clock/plugin/clipboardmenu.cpp

@ -71,6 +71,12 @@ void ClipboardMenu::setupMenu(QAction *action)
a = menu->addAction(s);
a->setData(s);
// the same as the option above but shows the opposite of the "show seconds" setting
// e.g if "show seconds" is enabled it will show the time without seconds and vice-versa
s = m_secondsIncluded ? QLocale().toString(time, QLocale::ShortFormat) : QLocale().toString(time, QLocale::LongFormat);
a = menu->addAction(s);
a->setData(s);
// e.g 4/28/22
s = QLocale().toString(date, QLocale::ShortFormat);
a = menu->addAction(s);

Loading…
Cancel
Save