[PC-BSD Commits] r21668 - pcbsd-projects/PCDM

svn at pcbsd.org svn at pcbsd.org
Wed Feb 27 11:34:50 PST 2013


Author: kenmoore
Date: 2013-02-27 19:34:50 +0000 (Wed, 27 Feb 2013)
New Revision: 21668

Modified:
   pcbsd-projects/PCDM/fancySwitcher.cpp
Log:
Adjust the fancy switcher size again, now make it show only 1/2 of the icons next to it



Modified: pcbsd-projects/PCDM/fancySwitcher.cpp
===================================================================
--- pcbsd-projects/PCDM/fancySwitcher.cpp	2013-02-27 19:22:42 UTC (rev 21667)
+++ pcbsd-projects/PCDM/fancySwitcher.cpp	2013-02-27 19:34:50 UTC (rev 21668)
@@ -37,7 +37,7 @@
   iconViewer->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
   iconViewer->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
   if(isHorizontal){
-    iconViewer->setFixedSize(3*iconSize,iconSize+2);
+    iconViewer->setFixedSize(2.5*iconSize,iconSize+2);
     pushBack->setIcon(QIcon(":images/left.png"));
     pushBack->setShortcut(tr("Ctrl+Left"));
     pushForward->setIcon(QIcon(":images/right.png"));
@@ -47,7 +47,7 @@
     layout->addWidget(pushForward,1,3);
     layout->addWidget(textLabel,2,1,1,3);
   }else{ //vertical
-    iconViewer->setFixedSize(iconSize+2,3*iconSize);
+    iconViewer->setFixedSize(iconSize+2,2.5*iconSize);
     pushBack->setIcon(QIcon(":images/up.png"));
     pushBack->setShortcut(tr("Ctrl+Up"));
     pushForward->setIcon(QIcon(":images/down.png"));
@@ -86,7 +86,7 @@
   //Create the scene with the proper dimensions
   scene = new QGraphicsScene(0,0,xsize,ysize);
   //Fill the scene with the given images
-  int offset = iconSize/2; //initial offset
+  int offset = iconSize*3/4; //initial offset ( (viewer width-iconsize)/2 )
   for(int i=0; i<idL.length(); i++){
     //qDebug() << "offset" << offset;
     if(isHorizontal){
@@ -313,9 +313,9 @@
   pushForward->setIconSize(QSize(iconSize/2,iconSize/2));
   //Update the iconViewer sizes
   if(isHorizontal){
-    iconViewer->setFixedSize(3*iconSize,iconSize+2);
+    iconViewer->setFixedSize(2.5*iconSize,iconSize+2);
   }else{
-    iconViewer->setFixedSize(iconSize+2,3*iconSize);
+    iconViewer->setFixedSize(iconSize+2,2.5*iconSize);
   }
   updateIconViewer();
 }



More information about the Commits mailing list