From 79df03631348f217c5739fc097c3b7ee53df499c Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 14 Nov 2017 14:17:27 -0500 Subject: Fix up some initial startmenu sizing. --- .../core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp | 6 +++--- src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src-qt5/core/lumina-desktop/panel-plugins') diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp index 30e82c47..562122ae 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp @@ -25,10 +25,10 @@ LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizon startmenu = new StartMenu(this); connect(startmenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) ); connect(startmenu, SIGNAL(UpdateQuickLaunch(QStringList)), this, SLOT(updateQuickLaunch(QStringList))); - menu->setContents(startmenu); - QRect screenSize = QApplication::desktop()->availableGeometry(this); - QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize", QSize(screenSize.width() * 0.2, screenSize.height())).toSize(); + //QRect screenSize = QApplication::desktop()->availableGeometry(this); + QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize", QSize(0, 0)).toSize(); if(!saved.isNull()){ startmenu->setFixedSize(saved); } //re-load the previously saved value + menu->setContents(startmenu); button->setMenu(menu); connect(menu, SIGNAL(aboutToHide()), this, SLOT(updateButtonVisuals()) ); diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp index c99e2b4b..beaa5d92 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp @@ -63,7 +63,7 @@ void StartMenu::UpdateAll(){ ui->tool_restart->setIcon(LXDG::findIcon("system-reboot","")); ui->tool_shutdown->setIcon(LXDG::findIcon("system-shutdown","")); ui->tool_suspend->setIcon(LXDG::findIcon("system-suspend","")); - + //Update Visibility of system/session/OS options // -- Control Panel QString tmp = LOS::ControlPanelShortcut(); -- cgit From 36f7dae7d983ab89532fb6613e75cf4491065e66 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 17 Nov 2017 12:34:27 -0500 Subject: Get rid of the updates available dialog/prompt in Lumina. Replace it with an extra "reboot w/ updates" button in both the start menu and the system logout window. --- .../panel-plugins/systemstart/StartMenu.cpp | 22 ++++++++--- .../panel-plugins/systemstart/StartMenu.h | 11 +++--- .../panel-plugins/systemstart/StartMenu.ui | 45 +++++++++++++++++----- 3 files changed, 57 insertions(+), 21 deletions(-) (limited to 'src-qt5/core/lumina-desktop/panel-plugins') diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp index beaa5d92..272bf0fa 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp @@ -507,6 +507,7 @@ void StartMenu::on_stackedWidget_currentChanged(int val){ tmp = LOS::audioVolume(); ui->frame_audio->setVisible(tmp >= 0); if(tmp >= 0){ ui->slider_volume->setValue(tmp); } + }else if(page == ui->page_leave){ if( !ui->frame_leave_system->whatsThis().isEmpty() ){ //This frame is allowed/visible - need to adjust the shutdown detection @@ -514,6 +515,7 @@ void StartMenu::on_stackedWidget_currentChanged(int val){ ui->tool_restart->setEnabled(!updating); ui->tool_shutdown->setEnabled(!updating); ui->label_updating->setVisible(updating); //to let the user know *why* they can't shutdown/restart right now + ui->tool_restart_updates->setVisible(!updating && !LOS::systemPendingUpdates().isEmpty() ); } ui->frame_leave_suspend->setVisible( LOS::systemCanSuspend() ); } @@ -590,17 +592,25 @@ void StartMenu::on_tool_logout_clicked(){ void StartMenu::on_tool_restart_clicked(){ emit CloseMenu(); QCoreApplication::processEvents(); - bool skipupdates = false; - if( !promptAboutUpdates(skipupdates) ){ return; } - LSession::handle()->StartReboot(skipupdates); + //bool skipupdates = false; + //if( !promptAboutUpdates(skipupdates) ){ return; } + LSession::handle()->StartReboot(true); +} + +void StartMenu::on_tool_restart_update_clicked(){ + emit CloseMenu(); + QCoreApplication::processEvents(); + //bool skipupdates = false; + //if( !promptAboutUpdates(skipupdates) ){ return; } + LSession::handle()->StartReboot(false); } void StartMenu::on_tool_shutdown_clicked(){ emit CloseMenu(); QCoreApplication::processEvents(); - bool skipupdates = false; - if( !promptAboutUpdates(skipupdates) ){ return; } - LSession::handle()->StartShutdown(skipupdates); + //bool skipupdates = false; + //if( !promptAboutUpdates(skipupdates) ){ return; } + LSession::handle()->StartShutdown(); } void StartMenu::on_tool_suspend_clicked(){ diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h index e2dbb273..41bc3ec4 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h @@ -73,6 +73,7 @@ private slots: void on_tool_lock_clicked(); void on_tool_logout_clicked(); void on_tool_restart_clicked(); + void on_tool_restart_update_clicked(); void on_tool_shutdown_clicked(); void on_tool_suspend_clicked(); @@ -80,17 +81,17 @@ private slots: void on_slider_volume_valueChanged(int); void on_tool_launch_mixer_clicked(); void on_tool_mute_audio_clicked(); - + //Screen Brightness void on_slider_bright_valueChanged(int); - + //Workspace void on_tool_set_nextwkspace_clicked(); void on_tool_set_prevwkspace_clicked(); - + //Locale void on_combo_locale_currentIndexChanged(int); - + //Search void on_line_search_textEdited(QString); void startSearch(); @@ -99,7 +100,7 @@ private slots: signals: void CloseMenu(); void UpdateQuickLaunch(QStringList); - + }; #endif diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui index d374bfce..500b6559 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui @@ -6,8 +6,8 @@ 0 0 - 181 - 405 + 336 + 466 @@ -42,7 +42,7 @@ - 4 + 3 @@ -142,8 +142,8 @@ 0 0 - 179 - 208 + 334 + 102 @@ -438,8 +438,8 @@ 0 0 - 179 - 299 + 334 + 277 @@ -1002,6 +1002,31 @@ + + + + + 0 + 0 + + + + QToolButton{ background-color: rgba(150,150,0,100); } + + + Update and Restart + + + + + + Qt::ToolButtonTextBesideIcon + + + true + + + @@ -1033,7 +1058,7 @@ - (System Performing Updates) + (System Preparing Updates) Qt::AlignCenter @@ -1099,8 +1124,8 @@ 0 0 - 167 - 345 + 308 + 351 -- cgit From 757ff403a95e72b2637eb435f6447c7031c75dc5 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 20 Nov 2017 15:24:19 -0500 Subject: Adjust the logout dialog size. Also add the current workspace to the panel button for the workspace switcher. --- .../panel-plugins/desktopswitcher/LDesktopSwitcher.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src-qt5/core/lumina-desktop/panel-plugins') diff --git a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp index e6e89075..294b37be 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp @@ -14,7 +14,7 @@ LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal) label = new QToolButton(this); label->setPopupMode(QToolButton::DelayedPopup); label->setAutoRaise(true); - label->setToolButtonStyle(Qt::ToolButtonIconOnly); + label->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); label->setIcon( LXDG::findIcon("format-view-carousel", "preferences-desktop-display") ); label->setToolTip(QString(tr("Workspace 1"))); connect(label, SIGNAL(clicked()), this, SLOT(openMenu())); @@ -44,7 +44,7 @@ void LDesktopSwitcher::setNumberOfDesktops(int number) { Atom atom = XInternAtom(display, "_NET_NUMBER_OF_DESKTOPS", False); XEvent xevent; xevent.type = ClientMessage; - xevent.xclient.type = ClientMessage; + xevent.xclient.type = ClientMessage; xevent.xclient.display = display; xevent.xclient.window = rootWindow; xevent.xclient.message_type = atom; @@ -129,7 +129,7 @@ void LDesktopSwitcher::createMenu() { int cur = LSession::handle()->XCB->CurrentWorkspace(); //current desktop number int tot = LSession::handle()->XCB->NumberOfWorkspaces(); //total number of desktops //qDebug() << "-- vor getCurrentDesktop SWITCH"; - qDebug() << "Virtual Desktops:" << tot << cur; + //qDebug() << "Virtual Desktops:" << tot << cur; menu->clear(); for (int i = 0; i < tot; i++) { QString name = QString(tr("Workspace %1")).arg( QString::number(i+1) ); @@ -137,6 +137,7 @@ void LDesktopSwitcher::createMenu() { menu->addAction(newAction(i, name)); } label->setToolTip(QString(tr("Workspace %1")).arg(QString::number(cur + 1))); + label->setText( QString::number(cur+1) ); } void LDesktopSwitcher::menuActionTriggered(QAction* act) { -- cgit From a881c51e7b20f086b6b8b546c116d38478f87840 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 21 Nov 2017 11:21:47 -0500 Subject: Quick adjustment for the finding of icons. Only use the fallback icon *after* the more expansive routine also fails. --- .../core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-desktop/panel-plugins') diff --git a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp index 1fd819b5..98770f18 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp @@ -16,7 +16,7 @@ AppLaunchButtonPlugin::AppLaunchButtonPlugin(QWidget *parent, QString id, bool h button->setAutoRaise(true); button->setToolButtonStyle(Qt::ToolButtonIconOnly); appfile = id.section("---",0,0).section("::",1,1); - if(!QFile::exists(appfile) && appfile.endsWith(".desktop")){ + if(!QFile::exists(appfile) && appfile.endsWith(".desktop")){ //might be a relative path - try to find the file appfile = LUtils::AppToAbsolute(appfile.section("/",-1) ); } -- cgit