Changeset 30611f7


Ignore:
Timestamp:
04/28/15 08:37:01 (2 months ago)
Author:
Kris Moore <kris@…>
Branches:
enter/10, releng/10.1.2
Children:
626350c
Parents:
5b62051
git-author:
Ken Moore <ken@…> (04/28/15 07:14:49)
git-committer:
Kris Moore <kris@…> (04/28/15 08:37:01)
Message:

Make PCDM a bit more monitor-resolution-scaling friendly.
Now, it will use 3.5% of the screen height for the default icon size (unless a pixel size is supplied in the theme file), as well as point sizes for the fonts in the default theme.

Location:
src-qt5/PCDM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src-qt5/PCDM/src/pcdm-gui.cpp

    ref56d95 r30611f7  
    7171    } 
    7272  } 
     73  //Define the default icon size 
     74  int perc = qRound(leftscreen->height()*0.035); //use 3.5% of the screen height 
     75  defIconSize = QSize(perc,perc); 
    7376  //Set the background image 
    7477  if(DEBUG_MODE){ qDebug() << "Setting Background Image"; } 
     
    122125    else{ toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); } //default to icon only 
    123126     
    124     toolbar->setIconSize( currentTheme->itemIconSize("toolbar") ); //use theme size 
     127    QSize tmpsz = currentTheme->itemIconSize("toolbar"); 
     128    if(!tmpsz.isValid()){ tmpsz = defIconSize; } 
     129    toolbar->setIconSize( tmpsz ); //use theme size 
    125130    toolbar->setFocusPolicy( Qt::NoFocus ); 
    126131  //Populate the Toolbar with items (starts at leftmost/topmost) 
     
    198203    //Set Icons from theme 
    199204    tmpIcon = currentTheme->itemIcon("login"); 
     205    tmpsz = currentTheme->itemIconSize("login"); 
     206    if(!tmpsz.isValid()){ tmpsz = defIconSize; } 
    200207    if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/next.png"; } 
    201     loginW->changeButtonIcon("login",tmpIcon, currentTheme->itemIconSize("login")); 
     208    loginW->changeButtonIcon("login",tmpIcon, tmpsz); 
    202209    tmpIcon = currentTheme->itemIcon("anonlogin"); 
     210    tmpsz = currentTheme->itemIconSize("login"); 
     211    if(!tmpsz.isValid()){ tmpsz = defIconSize; } 
    203212    if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/next-stealth.png"; } 
    204     loginW->changeButtonIcon("anonlogin", tmpIcon, currentTheme->itemIconSize("login")); 
     213    loginW->changeButtonIcon("anonlogin", tmpIcon, tmpsz); 
    205214    tmpIcon = currentTheme->itemIcon("user"); 
    206215    slotUserChanged(loginW->currentUsername()); //Make sure that we have the correct user icon 
    207216    tmpIcon = currentTheme->itemIcon("password"); 
     217    tmpsz = currentTheme->itemIconSize("password"); 
     218    if(!tmpsz.isValid()){ tmpsz = defIconSize; } 
    208219    if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/password.png"; } 
    209     loginW->changeButtonIcon("pwview",tmpIcon, currentTheme->itemIconSize("password")); 
     220    loginW->changeButtonIcon("pwview",tmpIcon, tmpsz); 
    210221    tmpIcon = currentTheme->itemIcon("encdevice"); 
     222    tmpsz = currentTheme->itemIconSize("device"); 
     223    if(!tmpsz.isValid()){ tmpsz = defIconSize; } 
    211224    if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/usbdevice.png"; } 
    212     loginW->changeButtonIcon("device", tmpIcon, currentTheme->itemIconSize("device")); 
     225    loginW->changeButtonIcon("device", tmpIcon, tmpsz); 
    213226    //Enable/disable the password view functionality 
    214227    loginW->allowPasswordView( Config::allowPasswordView() ); 
     
    228241    //----Desktop Environment Switcher 
    229242    if(simpleDESwitcher){ 
    230       loginW->setDesktopIconSize(currentTheme->itemIconSize("desktop")); 
     243      tmpsz = currentTheme->itemIconSize("desktop"); 
     244      if(!tmpsz.isValid()){ tmpsz = defIconSize; } 
     245      loginW->setDesktopIconSize(tmpsz); 
    231246    }else{ 
    232247      if(DEBUG_MODE){ qDebug() << " - Create DE Switcher"; } 
    233248      //Create the switcher 
    234249      deSwitcher = new FancySwitcher(this, !currentTheme->itemIsVertical("desktop") ); 
    235       QSize deSize = currentTheme->itemIconSize("desktop"); 
    236       deSwitcher->setIconSize(deSize.height()); 
     250      tmpsz = currentTheme->itemIconSize("desktop"); 
     251      if(!tmpsz.isValid()){ tmpsz = defIconSize; } 
     252      deSwitcher->setIconSize(tmpsz.height()); 
    237253      tmpIcon = currentTheme->itemIcon("nextde"); 
    238254      if( !tmpIcon.isEmpty() && QFile::exists(tmpIcon) ){ deSwitcher->changeButtonIcon("forward", tmpIcon); } 
     
    370386    if(!QFile::exists(tmpIcon) ){ tmpIcon= currentTheme->itemIcon("user"); } 
    371387    if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/user.png"; } 
    372     loginW->changeButtonIcon("display",tmpIcon, currentTheme->itemIconSize("user")); 
     388    QSize tmpsz = currentTheme->itemIconSize("user"); 
     389    if(!tmpsz.isValid()){ tmpsz = defIconSize; } 
     390    loginW->changeButtonIcon("display",tmpIcon, tmpsz); 
    373391  } 
    374392} 
  • src-qt5/PCDM/src/pcdm-gui.h

    ra2f1f4e r30611f7  
    7676    QTimer *pcTimer; //refresh timer 
    7777    QStringList pcAvail, pcCurrent, sysAvail; 
     78    QSize defIconSize; 
    7879     
    7980    QProcess* vkbd; 
  • src-qt5/PCDM/src/themeStruct.cpp

    ra2f1f4e r30611f7  
    204204  QSize ret; 
    205205  if( index == -1 ){  
    206     qDebug() << "ThemeStruct: Invalid item:"<<item; 
    207     ret = QSize(32,32); 
     206    //qDebug() << "ThemeStruct: Invalid item:"<<item; 
     207    //ret = QSize(32,32); 
    208208  }else{ 
    209209    ret = items[index].iconSize; 
  • src-qt5/PCDM/themes/default/default.theme

    ra2f1f4e r30611f7  
    2121   
    2222USER_IMAGE=default-user.png             # Image for the user selection widget 
    23   USER_IMAGE_SIZE=30x30                   # Size for the image (in pixels) 
     23 # USER_IMAGE_SIZE=30x30                  # Size for the image (in pixels) 
    2424   
    2525PASSWORD_IMAGE=password.png     # Default image for the password entry box 
    26   PASSWORD_IMAGE_SIZE=30x30               # Size for the image (in pixels) 
     26# PASSWORD_IMAGE_SIZE=30x30               # Size for the image (in pixels) 
    2727   
    2828LOGIN_IMAGE=login.png           # Image contained in the login button 
    2929ANONLOGIN_IMAGE=login-stealth.png #Image contained in the login button when stealth mode enabled 
    30   LOGIN_IMAGE_SIZE=35x35                  # Size for the image (in pixels) 
     30#  LOGIN_IMAGE_SIZE=35x35                 # Size for the image (in pixels) 
    3131 
    3232DESKTOP_IMAGE=default-desktop.png       # Default Image for the DE selection if none found 
    3333  DESKTOP_ORIENTATION=simple                    # [horizontal | vertical | simple] 
    34   DESKTOP_IMAGE_SIZE=30x30                      # Size for the image (in pixels) 
     34#  DESKTOP_IMAGE_SIZE=30x30                     # Size for the image (in pixels) 
    3535  #Additional DESKTOP settings if not set to "simple" 
    3636  NEXTDE_IMAGE=nextDE.png                       # Next DE selection (right/down) 
     
    4646# TOOLBAR SETTINGS 
    4747TOOLBAR_LOCATION=bottom         # [bottom | top | left | right] 
    48 TOOLBAR_IMAGE_SIZE=28x28     # Set the default size for all images in the toolbar 
     48#TOOLBAR_IMAGE_SIZE=28x28     # Set the default size for all images in the toolbar 
    4949TOOLBAR_STYLE=textbesideicon            # [icononly | textonly | textbesideicon | textundericon] 
    5050 
     
    7777# Header Image: QLabel 
    7878# ---------- 
     79# NOTE: Use point sizes (pt) for fonts so that they scale properly according to screen size!! 
     80# ---------- 
    7981APP_STYLESHEET_START 
    8082QToolBar{ background-color: rgba(253,253,255,100); } 
    8183QWindow{ background-color: white; color: black; } 
     84QWidget{ 
     85        font-size: 12pt; 
     86        font-family: Caladea; 
     87} 
    8288QListWidget{ 
    83         font-size: 20px; 
     89        font-size: 14pt; 
    8490        color: black; 
    8591        background: rgba(253,253,253,180); 
     
    8894} 
    8995QComboBox{ 
    90         font-size: 13px; 
    9196        color: black; 
    9297        background: rgba(253,253,253,180); 
     
    95100        color: black; 
    96101        background: rgba(253,253,253,180); 
    97         font-size: 13px; 
    98102} 
    99103QToolButton{ background-color: transparent; border: none; } 
     
    121125QPushButton:hover{ background-color: transparent; border: 1px solid grey; border-radius: 5px; } 
    122126QMessageBox{} 
    123 QWidget{} 
     127 
    124128 
    125129APP_STYLESHEET_STOP 
Note: See TracChangeset for help on using the changeset viewer.