Changeset b6c1838


Ignore:
Timestamp:
05/15/14 14:55:16 (10 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
401b845, dcf64bc
Parents:
2cb96b7
Message:

Make sure that the panel cannot be resized by too many widgets on the panel (such as when a user opens a gazillion windows). Instead all the widgets will be scaled down appropriately to fix the current panel size.
While I am here, also enable the system tray panel plugin. It is still quite rough - so do not enable it by default yet.

Location:
lumina
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • lumina/libLumina/LuminaX11.cpp

    re6e5ccdf rb6c1838  
    517517  } 
    518518  //Now register the orientation of the system tray 
    519   //int horz = _NET_SYSTEM_TRAY_ORIENTATION_HORZ; 
    520   //XChangeProperty(disp, trayID, XInternAtom(disp,"_NET_SYSTEM_TRAY_ORIENTATION",true), 
    521                 //XA_CARDINAL, 32, PropModeReplace, (unsigned char*) &horz, 1); 
     519  int horz = _NET_SYSTEM_TRAY_ORIENTATION_HORZ; 
     520  XChangeProperty(disp, LuminaSessionTrayID, XInternAtom(disp,"_NET_SYSTEM_TRAY_ORIENTATION",False), 
     521                XA_CARDINAL, 32, PropModeReplace, (unsigned char*) &horz, 1); 
    522522  //Now get the visual ID for the system tray 
    523523  XVisualInfo *XVI = new XVisualInfo; 
  • lumina/lumina-config/LPlugins.cpp

    re6e5ccdf rb6c1838  
    9494    info.ID = "taskmanager"; 
    9595    info.icon = "preferences-system-windows"; 
    96   PANEL.insert(info.ID, info);     
     96  PANEL.insert(info.ID, info);  
     97  //System Tray 
     98  info = LPI(); //clear it 
     99    info.name = QObject::tr("System Tray"); 
     100    info.description = QObject::tr("Display area for dockable system applications"); 
     101    info.ID = "systemtray"; 
     102    info.icon = "preferences-system-windows-actions"; 
     103  PANEL.insert(info.ID, info);   
    97104} 
    98105 
  • lumina/lumina-desktop/LPanel.cpp

    r441a9b7 rb6c1838  
    3232    layout->setAlignment(Qt::AlignLeft); 
    3333    layout->setSpacing(1); 
     34    //layout->setSizeConstraint(QLayout::SetFixedSize); 
    3435  this->setLayout(layout); 
    3536  QTimer::singleShot(1,this, SLOT(UpdatePanel()) ); //start this in a new thread 
     
    5758  } 
    5859  qDebug() << " - set Geometry"; 
     60  int xwid = screen->screenGeometry(screennum).width(); 
     61  int xhi = screen->screenGeometry(screennum).height(); 
    5962  if(loc=="top"){ 
    60     this->setGeometry(xoffset,0,screen->screenGeometry(screennum).width(), ht ); 
     63    QSize sz = QSize(xwid, ht); 
     64    this->setMinimumSize(sz); 
     65    this->setMaximumSize(sz); 
     66    this->setGeometry(xoffset,0,xwid, ht ); 
    6167    LX11::ReservePanelLocation(this->winId(), xoffset, 0, this->width(), ht); 
    6268  }else{ 
    63     this->setGeometry(xoffset,screen->screenGeometry(screennum).height()-ht,screen->screenGeometry(screennum).width(), ht ); 
    64     LX11::ReservePanelLocation(this->winId(), xoffset, screen->screenGeometry(screennum).height()-ht, this->width(), ht); 
     69    QSize sz = QSize(xwid, ht); 
     70    this->setMinimumSize(sz); 
     71    this->setMaximumSize(sz); 
     72    this->setGeometry(xoffset,screen->screenGeometry(screennum).height()-ht,xwid, ht ); 
     73    LX11::ReservePanelLocation(this->winId(), xoffset, xhi-ht, this->width(), ht); 
    6574  } 
    6675  //Now update the appearance of the toolbar 
  • lumina/lumina-desktop/LPanel.h

    r307712c rb6c1838  
    4949        void UpdateTheme(); //Theme Changed externally 
    5050 
    51 protected: 
    52         /*void moveEvent(QMoveEvent *event){ 
    53           QPoint pt; 
    54           if(settings->value(PPREFIX+"location","top").toString()=="top"){ pt = QPoint(0,0); } 
    55           else{ pt = QPoint(0, screen->screenGeometry(screennum).height() - this->height() ); } 
    56           if(event->pos() != pt){ 
    57             this->move(pt.x(), pt.y()); //In case the WM does not keep it in the proper place 
    58           } 
    59         }*/ 
    6051}; 
    6152 
  • lumina/lumina-desktop/panel-plugins/LPPlugin.h

    r214f3d5 rb6c1838  
    4747         
    4848public slots: 
    49         void LocaleChange(){ 
     49        virtual void LocaleChange(){ 
    5050          //This needs to be re-implemented in the subclassed plugin 
    5151            //This is where all text is set/translated 
    5252        } 
    53         void ThemeChange(){ 
     53        virtual void ThemeChange(){ 
    5454          //This needs to be re-implemented in the subclasses plugin 
    5555            //This is where all the visuals are set if using Theme-dependant icons. 
  • lumina/lumina-desktop/panel-plugins/NewPP.h

    re6e5ccdf rb6c1838  
    2121#include "desktopswitcher/LDesktopSwitcher.h" 
    2222#include "taskmanager/LTaskManagerPlugin.h" 
    23 //#include "systemtray/LSysTray.h" //must be last due to X11 compile issues 
     23#include "systemtray/LSysTray.h" //must be last due to X11 compile issues 
    2424 
    2525class NewPP{ 
     
    3535          }else if(plugin=="taskmanager"){ 
    3636            plug = new LTaskManagerPlugin(parent); 
    37           /*}else if(plugin=="systemtray"){ 
     37          }else if(plugin=="systemtray"){ 
    3838            plug = new LSysTray(parent); 
    39                   */ 
    4039          }else if(plugin=="desktopswitcher"){ 
    4140            plug = new LDesktopSwitcher(parent); 
  • lumina/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp

    rd3ece7b rb6c1838  
    9999  if(WINLIST.length() == 1){ 
    100100    //single window 
    101     this->setPopupMode(QToolButton::MenuButtonPopup); 
     101    this->setPopupMode(QToolButton::DelayedPopup); 
    102102    this->setMenu(actMenu); 
    103     this->setText( this->fontMetrics().elidedText(WINLIST[0].text(), Qt::ElideRight ,100) ); //max out at 100 pixel length 
     103    this->setText( this->fontMetrics().elidedText(WINLIST[0].text(), Qt::ElideRight ,80) ); 
    104104  }else if(WINLIST.length() > 1){ 
    105105    //multiple windows 
Note: See TracChangeset for help on using the changeset viewer.