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

svn at pcbsd.org svn at pcbsd.org
Fri Feb 15 07:42:32 PST 2013


Author: kenmoore
Date: 2013-02-15 15:42:32 +0000 (Fri, 15 Feb 2013)
New Revision: 21532

Modified:
   pcbsd-projects/PCDM/pcdm-gui.cpp
   pcbsd-projects/PCDM/pcdm.theme
   pcbsd-projects/PCDM/themeStruct.cpp
Log:
Now fix up the default background image, and turn off a bunch of the theme debugging



Modified: pcbsd-projects/PCDM/pcdm-gui.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-gui.cpp	2013-02-15 15:27:51 UTC (rev 21531)
+++ pcbsd-projects/PCDM/pcdm-gui.cpp	2013-02-15 15:42:32 UTC (rev 21532)
@@ -45,14 +45,17 @@
 
 void PCDMgui::createGUIfromTheme(){
   QString style;
+  QString tmpIcon; //used for checking image files before loading them
   //Fill a couple global variables
   kModels = Backend::keyModels();
   kLayouts = Backend::keyLayouts();
   //Set the background image
-  if( !currentTheme->itemIcon("background").isEmpty() ){
+  if( currentTheme->itemIsEnabled("background") ){
+    tmpIcon = currentTheme->itemIcon("background");
+    if( tmpIcon.isEmpty() || !QFile::exists(tmpIcon) ){ tmpIcon = ":/images/backgroundimage.jpg"; }
     //use "border-image" instead of "background-image" to stretch rather than tile the image
     QString bgstyle = "PCDMgui {border-image: url(BGIMAGE) stretch;}"; 
-    bgstyle.replace("BGIMAGE", currentTheme->itemIcon("background") );
+    bgstyle.replace("BGIMAGE", tmpIcon);
     style.append(bgstyle);
   }
   //Set the application style sheet
@@ -90,8 +93,8 @@
     toolbar->setIconSize( currentTheme->itemIconSize("toolbar") ); //use theme size
     
   //Populate the Toolbar with items (starts at leftmost/topmost)
-    QString tmpIcon = currentTheme->itemIcon("vkeyboard");
     //----Virtual Keyboard
+    tmpIcon = currentTheme->itemIcon("vkeyboard");
     if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/keyboard.png"; }
     virtkeyboardButton = new QAction( QIcon(tmpIcon),tr("Virtual Keyboard"),this );
     toolbar->addAction(virtkeyboardButton);

Modified: pcbsd-projects/PCDM/pcdm.theme
===================================================================
--- pcbsd-projects/PCDM/pcdm.theme	2013-02-15 15:27:51 UTC (rev 21531)
+++ pcbsd-projects/PCDM/pcdm.theme	2013-02-15 15:42:32 UTC (rev 21532)
@@ -13,9 +13,8 @@
 
 #### Images (relative to IMAGE_DIR) ####
 BACKGROUND_IMAGE=background.jpg  	# will stretch to fill the screen
+  BACKGROUND_DISABLE=FALSE		# Flag to disable using a background image
 
-SPLASHSCREEN_IMAGE=default-splash.png 	# Image to use as a splash screen while starting up
-
 HEADER_IMAGE=default-header.jpg 	# Image to be displayed as a window header
   HEADER_IMAGE_SIZE=800x200		# Size for the image (in pixels)
   HEADER_DISABLE=FALSE			# Flag to remove the header image entirely

Modified: pcbsd-projects/PCDM/themeStruct.cpp
===================================================================
--- pcbsd-projects/PCDM/themeStruct.cpp	2013-02-15 15:27:51 UTC (rev 21531)
+++ pcbsd-projects/PCDM/themeStruct.cpp	2013-02-15 15:42:32 UTC (rev 21532)
@@ -41,7 +41,7 @@
       QString itemName = prop.section("_",0,0).toLower(); //item name
       QString itemCat = prop.section("_",1,3).simplified();  //item category for value
       int index = itemNames.indexOf( itemName ); //index for this item
-      qDebug() << "File Item:" << prop << val << itemName << itemCat << index;
+      //qDebug() << "File Item:" << prop << val << itemName << itemCat << index;
       //Now save this item as appropriate
       if(prop == "IMAGE_DIR" && !val.isEmpty()){ //default directory for icons
 	if(!val.endsWith("/")){val.append("/");}
@@ -192,7 +192,7 @@
   }else{
     ret = items[index].iconSize;
   }
-  qDebug() << "Theme:" << item << "Size:" << ret;
+  //qDebug() << "Theme:" << item << "Size:" << ret;
   return ret;
 }
 



More information about the Commits mailing list