[PC-BSD Commits] r17711 - pcbsd-projects/PCDM
svn at pcbsd.org
svn at pcbsd.org
Wed Jul 11 07:20:29 PDT 2012
Author: kenmoore
Date: 2012-07-11 14:20:29 +0000 (Wed, 11 Jul 2012)
New Revision: 17711
Modified:
pcbsd-projects/PCDM/pcdm-themes.cpp
pcbsd-projects/PCDM/sample.pcdm-theme
Log:
Update the PCDM theme configuration to allow for a toolbar and toolbar items
Modified: pcbsd-projects/PCDM/pcdm-themes.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-themes.cpp 2012-07-11 13:56:10 UTC (rev 17710)
+++ pcbsd-projects/PCDM/pcdm-themes.cpp 2012-07-11 14:20:29 UTC (rev 17711)
@@ -1,42 +1,54 @@
#include "pcdm-themes.h"
//Setup variables that save the current theme data
-QStringList images;
+QStringList images, imSizes, imLayout, gridLayout;
bool isFullscreen=TRUE;
-bool isSplashscreen=FALSE;
int windowWidth, windowHeight, gridWidth, gridHeight;
-QString splashPath;
//Create the functions to read and output the theme data
void Theme::loadDefaults(QString vars){
if( (vars=="all") || (vars=="images") ){
- //Default Layout for the application
- images.clear();
- images << ":images/banner.png";
- images <<":images/backgroundimage.jpg";
- images <<":images/splash.jpg";
- images <<":images/user.png";
- images <<":images/password.png";
- images <<":images/next.png";
- images <<":images/keyboard.png";
- images <<":images/language.png";
- images <<":images/system.png";
- images <<":images/desktop.png";
+ //Default Images and Sizes
+ images.clear(); imSizes.clear();
+ images <<":images/banner.png"; imSizes << ""; // [0]=Header
+ images <<":images/backgroundimage.jpg"; imSizes << ""; // [1]=Background
+ images <<":images/splash.png"; imSizes << ""; // [2]=Splash Screen
+ images <<":images/user.png"; imSizes << "64x64"; // [3]=User
+ images <<":images/password.png"; imSizes << "64x64"; // [4]=Password
+ images <<":images/next.png"; imSizes << "15x15"; // [5]=Login
+ images <<":images/input-keyboard.png"; imSizes << "32x32"; // [6]=Keyboard Layout
+ images <<":images/language.png"; imSizes << "32x32"; // [7]=Locale
+ images <<":images/system.png"; imSizes << "32x32"; // [8]=System
+ images <<":images/desktop.png"; imSizes << "32x32"; // [9]=Desktop
+ images <<":images/keyboard.png"; imSizes << "32x32"; // [10]=Virtual Keyboard
}
if( (vars=="all") || (vars=="layout") ){
-
+ gridWidth=5; gridHeight=6;
+ //Default Layout for the application
+ imLayout.clear(); gridLayout.clear();
+ imLayout << "icononly"; gridLayout << "0-4x0"; // [0]=Header
+ imLayout << "icononly"; gridLayout << ""; // [1]=Background
+ imLayout << "icononly"; gridLayout << ""; // [2]=Splash Screen
+ imLayout << "left"; gridLayout << "1-3x1"; // [3]=User
+ imLayout << "left"; gridLayout << "1-3x2"; // [4]=Password
+ imLayout << "left"; gridLayout << "1-3x3"; // [5]=Login
+ imLayout << "icononly"; gridLayout << "0x5"; // [6]=Keyboard Layout
+ imLayout << "icononly"; gridLayout << "1x5"; // [7]=Locale
+ imLayout << "icononly"; gridLayout << "2x5"; // [8]=System
+ imLayout << "icononly"; gridLayout << "3x5"; // [9]=Desktop
+ imLayout << "icononly"; gridLayout << "4x5"; // [10]=Virtual Keyboard
}
}
void Theme::loadTheme(QString themeFile){
- loadDefaults("all");
+ loadDefaults("all"); //Initial creation and filling of arrays
if(QFile::exists(themeFile)){
- readThemeFile(themeFile);
+ readThemeFile(themeFile); //change array fields as necessary
qDebug() << "PCDM: Loaded theme file" << themeFile;
if(!goodLayout){
- loadDefaults("layout");
+ loadDefaults("layout"); //return to default layout if theme layout is not valid
qDebug() << "PCDM: Invalid Theme Layout Detected - Using default layout instead
}
}else{
@@ -66,6 +78,8 @@
}
bool Theme::useSplashscreen(){
+ if(images[2].isEmpty() || images[2] == "disabled"){ return FALSE; }
+ else
return isSplashscreen;
}
Modified: pcbsd-projects/PCDM/sample.pcdm-theme
===================================================================
--- pcbsd-projects/PCDM/sample.pcdm-theme 2012-07-11 13:56:10 UTC (rev 17710)
+++ pcbsd-projects/PCDM/sample.pcdm-theme 2012-07-11 14:20:29 UTC (rev 17711)
@@ -43,21 +43,31 @@
WINDOW_SIZE=800x600 # Width & Height in pixels (if set to manual)
# ADD WINDOW ITEMS ON A GRID LAYOUT
- WINDOW_GRID_SIZE=[4,7] # number of [columns,rows] to fill the window
- # FORMAT: WINDOW_ITEM=<item>::<relative icon location>::[column,row]
- # <item>: [header | login | user | password | keyboard | locale | desktop | system]
- # <relative icon location>: [above|below|left|right|none|icononly] (not used for header item)
- # [column,row]: positive integers designating grid point(s) to use for the object (starting at 0)
+ WINDOW_GRID_SIZE=[7,3] # number of [rows,columns] to fill the window
+ # FORMAT: WINDOW_ITEM=<item>::<relative icon location>::[row,column]
+ # <item>: [header | login | user | password | keyboard | locale | desktop | system]
+ # <relative icon location>: [above|below|left|right|none|icononly] (not used for header item)
+ # [row,column]: positive integers designating grid point(s) to use for the object (starting at 0)
# Note: [0,0]=upper left corner, therefore if number of rows=4, valid row entries are 0->3
- WINDOW_ITEM=header::icononly::[0-3,0] #(optional) top row, columns 0-3 (all of them in this example)
- WINDOW_ITEM=user::left::[1-2,2] #(required) user icon can NOT be "icononly" (input required)
- WINDOW_ITEM=password::left::[1-2,3] #(required) password icon can NOT be "icononly" (input required)
- WINDOW_ITEM=login::left::[1-2,4] #(required) login icon MUST be "none", "icononly", or "left"
- WINDOW_ITEM=keyboard::above::[0,6] #(optional) keyboard switcher in bottom left corner
- WINDOW_ITEM=locale::above::[1,6] #(optional) locale switcher
- WINDOW_ITEM=desktop::above::[2,6] #(required) Desktop environment switcher
- WINDOW_ITEM=system::icononly::[3,6] #(required) system options MUST be "icononly"
+ WINDOW_ITEM=header::icononly::[0,0-2] #(optional) top row, columns 0-3 (all of them in this example)
+ WINDOW_ITEM=user::left::[2,1] #(required) user icon can NOT be "icononly" (input required)
+ WINDOW_ITEM=password::left::[3,1] #(required) password icon can NOT be "icononly" (input required)
+ WINDOW_ITEM=login::left::[4,1] #(required) login icon MUST be "none", "icononly", or "left"
+ WINDOW_ITEM=desktop::above::[6,1] #(required) Desktop environment switcher
+ # Add Toolbar Items
+ WINDOW_TOOLBAR_LOCATION=bottom # [bottom,top,left,right]
+ TOOLBAR_DEFAULT_SIZE=32x32 # Set the default size for all images in the toolbar
+ TOOLBAR_STYLE=icononly # [icononly | textonly | textbesideicon | textundericon]
+ # FORMAT: TOOLBAR_ITEM=<item>::<style>::<location>
+ # <item>: [keyboard | locale | desktop | system]
+ # <style>: [currentstyle | pulldown]
+ # <location>: positive integer value for order on toolbar (0 = top/leftmost item)
+ TOOLBAR_ITEM=system::currentstyle::0 #(required) system options MUST exist
+ TOOLBAR_ITEM=locale::pulldown::1 #(optional) locale switcher
+ TOOLBAR_ITEM=keyboard::pulldown::2 #(optional) keyboard layout switcher
+
+
More information about the Commits
mailing list