aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h16
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp2
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h15
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp2
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp78
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp7
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h13
7 files changed, 65 insertions, 68 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h
index 3aa3c7ad..f146df66 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h
@@ -24,11 +24,11 @@
// PANEL PLUGIN BUTTON
class AppLaunchButtonPlugin : public LPPlugin{
Q_OBJECT
-
+
public:
AppLaunchButtonPlugin(QWidget *parent = 0, QString id = "applauncher", bool horizontal=true);
~AppLaunchButtonPlugin();
-
+
private:
QToolButton *button;
QString appfile;
@@ -50,14 +50,18 @@ public slots:
this->layout()->update();
updateButtonVisuals();
}
-
- void LocaleChange(){
+ void LocaleChange(){
updateButtonVisuals();
}
-
void ThemeChange(){
updateButtonVisuals();
}
+protected:
+ void changeEvent(QEvent *ev){
+ LPPlugin::changeEvent(ev);
+ QEvent::Type tmp = ev->type();
+ if(tmp == QEvent::StyleChange || tmp==QEvent::ThemeChange || tmp==QEvent::LanguageChange || tmp==QEvent::LocaleChange){ updateButtonVisuals(); }
+ }
};
-#endif \ No newline at end of file
+#endif
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
index be5b8488..cae73d13 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
@@ -77,7 +77,7 @@ void LBattery::updateBattery(bool force){
break;
}
if(icon<iconOld && icon==0){
- //Play some audio warning chime when
+ //Play some audio warning chime when
QString sfile = LSession::handle()->sessionSettings()->value("audiofiles/batterylow", LOS::LuminaShare()+"low-battery.ogg").toString();
LSession::handle()->playAudioFile(sfile);
}
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
index 29562d5d..d14cfc53 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
@@ -25,12 +25,12 @@ class LBattery : public LPPlugin{
public:
LBattery(QWidget *parent = 0, QString id = "battery", bool horizontal=true);
~LBattery();
-
+
private:
QTimer *timer;
QLabel *label;
int iconOld;
-
+
private slots:
void updateBattery(bool force = false);
QString getRemainingTime();
@@ -39,7 +39,7 @@ public slots:
void LocaleChange(){
updateBattery(true);
}
-
+
void OrientationChange(){
if(this->layout()->direction()==QBoxLayout::LeftToRight){
label->setFixedSize( QSize(this->height(), this->height()) );
@@ -48,6 +48,15 @@ public slots:
}
updateBattery(true); //force icon refresh
}
+protected:
+ void changeEvent(QEvent *ev){
+ LPPlugin::changeEvent(ev);
+ QEvent::Type tmp = ev->type();
+ if(tmp==QEvent::ThemeChange || tmp==QEvent::LanguageChange || tmp==QEvent::LocaleChange){
+ updateBattery(true);
+ }
+ }
+
};
#endif
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 8e0a9d28..e6e89075 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
@@ -16,7 +16,7 @@ LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal)
label->setAutoRaise(true);
label->setToolButtonStyle(Qt::ToolButtonIconOnly);
label->setIcon( LXDG::findIcon("format-view-carousel", "preferences-desktop-display") );
- label->setToolTip(QString("Workspace 1"));
+ label->setToolTip(QString(tr("Workspace 1")));
connect(label, SIGNAL(clicked()), this, SLOT(openMenu()));
menu = new QMenu(this);
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(menuActionTriggered(QAction*)));
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 1992db0f..e8df8390 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
@@ -35,15 +35,15 @@ StartMenu::StartMenu(QWidget *parent) : QWidget(parent), ui(new Ui::StartMenu){
}
StartMenu::~StartMenu(){
-
+
}
void StartMenu::UpdateAll(){
//Update all the icons/text on all the pages
-
+
// Update Text
ui->retranslateUi(this);
-
+
//Update Icons
ui->tool_goto_apps->setIcon(LXDG::findIcon("system-run",""));
ui->tool_goto_settings->setIcon(LXDG::findIcon("preferences-system",""));
@@ -53,7 +53,7 @@ void StartMenu::UpdateAll(){
ui->tool_goto_logout->setIcon(LXDG::findIcon("system-log-out",""));
ui->tool_back->setIcon(LXDG::findIcon("go-previous",""));
ui->tool_launch_deskinfo->setIcon(LXDG::findIcon("system-help",""));
-
+
ui->tool_launch_mixer->setIcon( LXDG::findIcon("preferences-desktop-sound","") );
ui->label_bright_icon->setPixmap( LXDG::findIcon("preferences-desktop-brightness","").pixmap(ui->tool_goto_apps->iconSize()) );
ui->label_locale_icon->setPixmap( LXDG::findIcon("preferences-desktop-locale","").pixmap(ui->tool_goto_apps->iconSize()) );
@@ -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();
@@ -156,11 +156,11 @@ void StartMenu::UpdateQuickLaunch(QString path, bool keep){
// ==========================
/*void StartMenu::deleteChildren(QWidget *obj){
if(obj->layout()==0){
- for(int i=0; i<obj->children().count(); i++){
- obj->children().at(i)->deleteLater();
+ for(int i=0; i<obj->children().count(); i++){
+ obj->children().at(i)->deleteLater();
}
}else{
-
+
}
}*/
@@ -174,7 +174,7 @@ void StartMenu::ClearScrollArea(QScrollArea *area){
if(area == ui->scroll_favs){
area->takeWidget()->deleteLater();
}
- if(area->widget()==0){
+ if(area->widget()==0){
area->setWidget( new QWidget(area) ); //create a new widget in the scroll area
}
if(area->widget()->layout()==0){
@@ -203,7 +203,7 @@ void StartMenu::SortScrollArea(QScrollArea *area){
for(int i=0; i<lay->count(); i++){
items << lay->itemAt(i)->widget()->whatsThis();
}
-
+
items.sort();
//qDebug() << " - Sorted Items:" << items;
for(int i=0; i<items.length(); i++){
@@ -223,10 +223,10 @@ void StartMenu::SortScrollArea(QScrollArea *area){
void StartMenu::do_search(QString search, bool force){
search = search.simplified(); //remove unneccesary whitespace
- if(search == CSearch && !force){
+ if(search == CSearch && !force){
//nothing new - just ensure the page is visible
if(ui->stackedWidget->currentWidget()!=ui->page_search ){ ui->stackedWidget->setCurrentWidget(ui->page_search); }
- return;
+ return;
}else if(search.isEmpty()){
CSearch.clear();
if(ui->stackedWidget->currentWidget()==ui->page_search ){ on_tool_back_clicked(); }
@@ -234,7 +234,7 @@ void StartMenu::do_search(QString search, bool force){
}
//Got a search term - check it
CSearch = search; //save this for comparison later
- qDebug() << "Search for term:" << search;
+ //qDebug() << "Search for term:" << search;
ClearScrollArea(ui->scroll_search);
topsearch.clear();
//Now find any items which match the search
@@ -275,7 +275,7 @@ void StartMenu::do_search(QString search, bool force){
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) );
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) );
- if(i%3==0){
+ if(i%3==0){
QApplication::processEvents();
if(searchTimer->isActive()){ return; } //search changed - go ahead and stop here
}
@@ -305,13 +305,13 @@ bool StartMenu::promptAboutUpdates(bool &skip){
// PRIVATE SLOTS
// ========================
void StartMenu::LaunchItem(QString path, bool fix){
- if(path.startsWith("chcat::::")){
+ if(path.startsWith("chcat::::")){
ChangeCategory(path.section("::::",1,50));
return;
}
- qDebug() << "Launching Item:" << path << fix;
+ //qDebug() << "Launching Item:" << path << fix;
if(!path.isEmpty()){
- qDebug() << "Launch Application:" << path;
+ //qDebug() << "Launch Application:" << path;
if( fix && !path.startsWith("lumina-open") ){ LSession::LaunchApplication("lumina-open \""+path+"\""); }
else{ LSession::LaunchApplication(path); }
emit CloseMenu(); //so the menu container will close
@@ -355,7 +355,7 @@ void StartMenu::UpdateApps(){
connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) );
}
}
-
+
}else if(ui->check_apps_showcats->checkState() == Qt::Checked){
//qDebug() << " - Checked";
//Only show categories to start with - and have the user click-into a cat to see apps
@@ -378,7 +378,7 @@ void StartMenu::UpdateApps(){
ui->scroll_apps->widget()->layout()->addWidget(it);
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
//Show apps for this cat
- QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value(CCat);
+ QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value(CCat);
for(int i=0; i<apps.length(); i++){
//qDebug() << " - App:" << apps[i].name;
ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), apps[i] );
@@ -390,11 +390,11 @@ void StartMenu::UpdateApps(){
connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) );
}
}
-
+
}else{
//qDebug() << " - Not Checked";
//No categories at all - just alphabetize all the apps
- QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value("All");
+ QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value("All");
CCat.clear();
//Now add all the apps for this category
for(int i=0; i<apps.length(); i++){
@@ -407,8 +407,7 @@ void StartMenu::UpdateApps(){
connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) );
}
}
-
-
+
}
void StartMenu::UpdateFavs(){
@@ -427,31 +426,7 @@ void StartMenu::UpdateFavs(){
else{ tmp = rest; } //everything left over
if(type==1){
SortScrollArea(ui->scroll_favs);
- //Need to run a special routine for sorting the apps (already in the widget)
- //qDebug() << "Sort App Widgets...";
- // Since each app actually might have a different name listed within the file
- /*QLayout *lay = ui->scroll_favs->widget()->layout();
- QStringList items;
- for(int i=0; i<lay->count(); i++){
- items << lay->itemAt(i)->widget()->whatsThis().toLower();
- }
-
- items.sort();
- // qDebug() << " - Sorted Items:" << items;
- for(int i=0; i<items.length(); i++){
- if(items[i].isEmpty()){ continue; }
- //QLayouts are weird in that they can only add items to the end - need to re-insert almost every item
- for(int j=0; j<lay->count(); j++){
- //Find this item
- if(lay->itemAt(j)->widget()->whatsThis().toLower()==items[i]){
- //Found it - now move it if necessary
- //qDebug() << "Found Item:" << items[i] << i << j;
- lay->addItem( lay->takeAt(j) );
- break;
- }
- }
- }*/
-
+
}//end of special app sorting routine
tmp.sort(); //Sort alphabetically by name (dirs/files)
for(int i=0; i<tmp.length(); i++){
@@ -472,7 +447,6 @@ void StartMenu::UpdateFavs(){
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) );
}
- //QApplication::processEvents();
} //end loop over types
ui->scroll_favs->update();
//qDebug() << "End updateFavs";
@@ -541,7 +515,7 @@ void StartMenu::on_stackedWidget_currentChanged(int val){
}
ui->frame_leave_suspend->setVisible( LOS::systemCanSuspend() );
}
-
+
}
void StartMenu::catViewChanged(){
@@ -567,7 +541,7 @@ void StartMenu::on_tool_goto_apps_clicked(){
}
void StartMenu::on_tool_goto_settings_clicked(){
- ui->stackedWidget->setCurrentWidget(ui->page_settings);
+ ui->stackedWidget->setCurrentWidget(ui->page_settings);
}
void StartMenu::on_tool_goto_logout_clicked(){
@@ -585,7 +559,7 @@ void StartMenu::on_tool_launch_controlpanel_clicked(){
}
void StartMenu::on_tool_launch_fm_clicked(){
- LaunchItem(QDir::homePath());
+ LaunchItem(QDir::homePath());
}
void StartMenu::on_tool_launch_store_clicked(){
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp
index ab4e786f..8f867261 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp
@@ -30,7 +30,7 @@ LTaskButton::LTaskButton(QWidget *parent, bool smallDisplay) : LTBWidget(parent)
}
LTaskButton::~LTaskButton(){
-
+
}
//===========
@@ -81,11 +81,12 @@ LWinInfo LTaskButton::currentWindow(){
//=============
// PUBLIC SLOTS
//=============
+
void LTaskButton::UpdateButton(){
if(winMenu->isVisible()){ return; } //skip this if the window menu is currently visible for now
bool statusOnly = (WINLIST.length() == LWINLIST.length());
LWINLIST = WINLIST;
-
+
winMenu->clear();
LXCB::WINDOWVISIBILITY showstate = LXCB::IGNORE;
for(int i=0; i<WINLIST.length(); i++){
@@ -98,7 +99,7 @@ void LTaskButton::UpdateButton(){
//Update the button visuals from the first window
this->setIcon(WINLIST[i].icon(noicon));
cname = WINLIST[i].Class();
- if(cname.isEmpty()){
+ if(cname.isEmpty()){
//Special case (chrome/chromium does not register *any* information with X except window title)
cname = WINLIST[i].text();
if(cname.contains(" - ")){ cname = cname.section(" - ",-1); }
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
index 6b171c6a..ff551998 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
@@ -15,6 +15,7 @@
#include <QMenu>
#include <QEvent>
#include <QAction>
+#include <QTimer>
// libLumina includes
#include <LuminaXDG.h>
@@ -29,7 +30,7 @@ class LTaskButton : public LTBWidget{
public:
LTaskButton(QWidget *parent=0, bool smallDisplay = true);
~LTaskButton();
-
+
//Window Information
QList<WId> windows();
QString classname();
@@ -56,6 +57,7 @@ public slots:
void UpdateMenus(); //re-create the menus (text + icons)
private slots:
+
void buttonClicked();
void closeWindow(); //send the signal to close a window
void maximizeWindow(); //send the signal to maximize/restore a window
@@ -66,7 +68,14 @@ private slots:
void triggerWindow(); //change b/w visible and invisible
void winClicked(QAction*);
void openActionMenu();
-
+protected:
+ void changeEvent(QEvent *ev){
+ LTBWidget::changeEvent(ev);
+ QEvent::Type tmp = ev->type();
+ if(tmp==QEvent::ThemeChange || tmp==QEvent::LanguageChange || tmp==QEvent::LocaleChange){
+ QTimer::singleShot(qrand()%100+500, this, SLOT(UpdateButton()) );
+ }
+ }
signals:
void MenuClosed();
};
bgstack15