aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins
diff options
context:
space:
mode:
authorJesse Smith <jessefrgsmith@yahoo.ca>2014-09-15 19:45:53 -0300
committerJesse Smith <jessefrgsmith@yahoo.ca>2014-09-15 19:45:53 -0300
commit7cd91c78c5219a2391a3c4a9a1c2e446989d4c2f (patch)
treec8163ad1f3458dae66f8e0e905fcd7258d8b898c /lumina-desktop/panel-plugins
parentSelect the first exec entry from a .desktop file rather than the last. (diff)
parentUpdate the Lumina user button a bit: (diff)
downloadlumina-7cd91c78c5219a2391a3c4a9a1c2e446989d4c2f.tar.gz
lumina-7cd91c78c5219a2391a3c4a9a1c2e446989d4c2f.tar.bz2
lumina-7cd91c78c5219a2391a3c4a9a1c2e446989d4c2f.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'lumina-desktop/panel-plugins')
-rw-r--r--lumina-desktop/panel-plugins/LTBWidget.h2
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserWidget.cpp30
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserWidget.h2
3 files changed, 21 insertions, 13 deletions
diff --git a/lumina-desktop/panel-plugins/LTBWidget.h b/lumina-desktop/panel-plugins/LTBWidget.h
index 02097039..5252c619 100644
--- a/lumina-desktop/panel-plugins/LTBWidget.h
+++ b/lumina-desktop/panel-plugins/LTBWidget.h
@@ -25,7 +25,7 @@ private:
else if(cstate == Lumina::VISIBLE){ background = "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(255, 255, 255, 240), stop:0.505682 rgba(240, 240, 240, 150), stop:1 rgba(210, 210, 210, 55));"; border="border: 1px solid transparent;"; }
else if(cstate == Lumina::INVISIBLE){background = "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(215, 215, 215, 240), stop:0.505682 rgba(184, 185, 186, 150), stop:1 rgba(221, 246, 255, 55));"; border="border: 1px solid transparent;"; }
else if(cstate == Lumina::ACTIVE){ background= "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(241, 233, 156, 240), stop:0.355682 rgba(255, 243, 127, 150), stop:1 rgba(221, 246, 255, 55));"; border ="border: 1px solid transparent;"; }
- else if(cstate == Lumina::NOTIFICATION){ background= "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(252, 187, 127, 240), stop:0.505682 rgba(255, 222, 197, 150), stop:1 rgba(221, 246, 255, 55));"; border="border: 1px solid transparent"; }
+ else if(cstate == Lumina::NOTIFICATION){ background= "background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(252, 187, 127, 240), stop:0.505682 rgba(255, 222, 197, 150), stop:1 rgba(221, 246, 255, 55));"; border="border: 1px solid transparent;"; }
QString raw = rawstyle;
this->setStyleSheet( raw.replace("%1",background).replace("%2", border) );
}
diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
index 8b49ed43..1571760b 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
@@ -75,7 +75,8 @@ UserWidget::UserWidget(QWidget* parent) : QWidget(parent), ui(new Ui::UserWidget
}else{
ui->tool_qtconfig->setVisible(false);
}
-
+ lastUpdate = QDateTime::currentDateTime().addSecs(-30); //make sure it refreshes
+ QTimer::singleShot(10,this, SLOT(UpdateMenu())); //make sure to load this once after initialization
}
UserWidget::~UserWidget(){
@@ -100,15 +101,19 @@ void UserWidget::ClearScrollArea(QScrollArea *area){
// PRIVATE SLOTS
//============
void UserWidget::UpdateMenu(){
- ui->tabWidget->setCurrentWidget(ui->tab_fav);
- ui->tool_fav_apps->setChecked(true);
- ui->tool_fav_dirs->setChecked(false);
- ui->tool_fav_files->setChecked(false);
- cfav = 0; //favorite apps
- updateFavItems();
- updateHome();
- updateAppCategories();
- updateApps();
+ if(QDateTime::currentDateTime() > lastUpdate.addSecs(30)){
+ //Only re-arrange/reload things if not rapidly re-run
+ ui->tabWidget->setCurrentWidget(ui->tab_fav);
+ ui->tool_fav_apps->setChecked(true);
+ ui->tool_fav_dirs->setChecked(false);
+ ui->tool_fav_files->setChecked(false);
+ cfav = 0; //favorite apps
+ updateFavItems();
+ updateHome();
+ updateAppCategories();
+ updateApps();
+ }
+ lastUpdate = QDateTime::currentDateTime();
}
void UserWidget::LaunchItem(QString cmd){
@@ -170,7 +175,8 @@ void UserWidget::updateAppCategories(){
cats.sort();
for(int i=0; i<cats.length(); i++){
QString name, icon;
- if(cats[i] == "Multimedia"){ name = tr("Multimedia"); icon = "applications-multimedia"; }
+ if(cats[i] == "All"){ name = tr("All"); icon = "application-x-executable"; }
+ else if(cats[i] == "Multimedia"){ name = tr("Multimedia"); icon = "applications-multimedia"; }
else if(cats[i] == "Development"){ name = tr("Development"); icon = "applications-development"; }
else if(cats[i] == "Education"){ name = tr("Education"); icon = "applications-education"; }
else if(cats[i] == "Game"){ name = tr("Games"); icon = "applications-games"; }
@@ -180,7 +186,7 @@ void UserWidget::updateAppCategories(){
else if(cats[i] == "Science"){ name = tr("Science"); icon = "applications-science"; }
else if(cats[i] == "Settings"){ name = tr("Settings"); icon = "preferences-system"; }
else if(cats[i] == "System"){ name = tr("System"); icon = "applications-system"; }
- else if(cats[i] == "Utility"){ name = tr("Utility"); icon = "applications-utilities"; }
+ else if(cats[i] == "Utility"){ name = tr("Utilities"); icon = "applications-utilities"; }
else{ name = tr("Unsorted"); icon = "applications-other"; }
ui->combo_app_cats->addItem( LXDG::findIcon(icon,""), name, cats[i] );
}
diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.h b/lumina-desktop/panel-plugins/userbutton/UserWidget.h
index b9eaffbe..0b42bff8 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserWidget.h
+++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.h
@@ -15,6 +15,7 @@
#include <QHash>
#include <QVBoxLayout>
#include <QScrollArea>
+#include <QDateTime>
#include <LuminaXDG.h>
#include <LuminaOS.h>
@@ -40,6 +41,7 @@ public:
private:
Ui::UserWidget *ui;
QHash<QString, QList<XDGDesktop> > *sysapps;
+ QDateTime lastUpdate;
int cfav; //current favorite category
void ClearScrollArea(QScrollArea *area);
bgstack15