Commit d71338c3 authored by Langston Ball's avatar Langston Ball
Browse files

refs #1108 - update properties in screeninfo class, update display in settings...

refs #1108 - update properties in screeninfo class, update display in settings to show which selected dpi, adds theme for small ui / high dpi combo.
parent 19c160c1
......@@ -76,6 +76,7 @@ class ScreenObject : public QObject
Q_PROPERTY(int width READ width() NOTIFY sizeChanged)
Q_PROPERTY(int height READ height() NOTIFY sizeChanged)
Q_PROPERTY(double pixelRatio READ pixelRatio NOTIFY pixelRatioChanged)
Q_PROPERTY(QString pixelDensityString READ pixelDensityString NOTIFY pixelRatioChanged)
public:
ScreenObject():
......
import QtQuick 2.4
QtObject{
id:applicationStyle
objectName: "style"
function scaleX(w){
return w/100*manager.appWidth
}
function scaleY(y){
return y/100*manager.appHeight
}
function dumpObj(obj, message){
console.log((message? message+"\n\t" : "No Message \n\t")+ JSON.stringify(obj, null, "\t"))
}
readonly property double dpRatio:screenInfo.primaryScreen.pixelRatio/2
//picture ratios - will be moved to cpp class
property double dvdPosterRatio:955/1080
property double hdPosterRatio:755/1080
property double cdCoverRatioFront:1080/1080
property double cdCoverRatioBack:1080/1264
property double vcdRatio:1080/1080
property double vhsRatio:1280/620
/* Transitions */
readonly property int transition_animationTime:350
readonly property int transition_accentTime:500
readonly property int transitionFadeTime:350
/* Application Colors */
readonly property color appcolor_background: "#0588ff"
readonly property color appcolor_background_light: "#80c4ff"
readonly property color appcolor_background_medium:"#43acff"
readonly property color appcolor_background_list:"#222222"
readonly property color appcolor_foregroundColor:"darkgreen"
readonly property color appcolor_navigationBackgroundColor:"blue"
/*Application Buttons */
readonly property string appbutton_confirm_color:appcolor_background
readonly property color appbutton_cancel_color:"#f26c4f"
readonly property color appbutton_disabled_color:"#464646"
readonly property color appbutton_color:appcolor_background
property int appButtonHeight:manager.isProfile ? scaleY(15) : scaleY(17)
property int appButtonWidth: manager.isProfile ? scaleX(28) : scaleX(18)
readonly property int appButtonNumberPadHeight:manager.isProfile ? scaleY(12) : scaleY(18)
readonly property int appButtonNumberPadWidth: manager.isProfile ? scaleX(18) : scaleX(12)
readonly property int appButtonNumberPadSmallHeight:manager.isProfile ? scaleY(9) : scaleY(15)
readonly property int appButtonNumberPadSmallWidth:manager.isProfile ? scaleX(15) : scaleX(9)
readonly property int appButtonLargeHeight:manager.isProfile ? scaleY(15) : scaleY(20)
readonly property int appButtonLargeWidth:manager.isProfile ? scaleX(28) : scaleX(25)
readonly property int buttonSpacing:5
/* Application Fonts */
readonly property color apptext_color_active:"white"
readonly property color apptext_color_inactive:"grey"
readonly property color apptext_color_list_active:"blue"
readonly property int appFontSize_list:42*dpRatio
readonly property int appFontSize_header:36*dpRatio
readonly property int appFontSize_description:28*dpRatio
readonly property int appFontSize_title:64*dpRatio
property int fontSize_small:appFontSize_list
property int fontSize_medium:appFontSize_description
property int fontSize_large:appFontSize_title
property int fontSize_listItem:28*dpRatio
property int fontSize_listTitle:36*dpRatio
property int fontSize_listAccent:24*dpRatio
/* Application Navigation Bars */
readonly property string appbutton_navigationButtonHeight:manager.isProfile ? scaleY(15) : scaleY(17)
readonly property string appNavigation_panelHeight:manager.isProfile ? scaleY(10) : scaleY(15)
/* Application Menu Panels */
readonly property int appMenuPanel_height:manager.isProfile ? scaleY(9) : scaleY(6)
readonly property int appMenuPanel_widthSmall:scaleX(25)
readonly property int appMenuPanel_widthMedium:scaleX(45)
readonly property int appMenuPanel_widthLarge:scaleX(85)
/* Application List Views */
readonly property int listViewWidth_large:scaleX(55)
readonly property int listViewWidth_medium:manager.b_orientation ? scaleX(30) : scaleX(15)
readonly property int listViewWidth_small:manager.b_orientation ? scaleX(20) : scaleX(15)
readonly property int listViewItemHeight:manager.isProfile ? scaleY(12) : scaleY(15)
readonly property int listViewMargin:manager.isProfile ? scaleX(5) : scaleX(2.5)
/* Dialogs */
readonly property int dialog_large_height:scaleY(75)
readonly property int dialog_large_width:scaleX(85)
//opacity and accents
readonly property double appHeader_opacity:.55
readonly property double appPanel_opacity:.45
readonly property double appList_opacity:.89
//remote Screens
readonly property double remote_posterHeight:manager.isProfile ? scaleY(100) : scaleY(55)
readonly property double remote_posterWidth:remote_posterHeight*hdPosterRatio
readonly property double remote_albumHeight:manager.b_orientation ? scaleY(50) : scaleY(75)
readonly property double remote_albumWidth:remote_albumHeight
}
......@@ -31,7 +31,7 @@ QtObject{
readonly property int transitionFadeTime:350
/* Application Colors */
readonly property color appcolor_background:"#0588ff"
readonly property color appcolor_background:"red" // "#0588ff"
readonly property color appcolor_background_light: "#80c4ff"
readonly property color appcolor_background_medium:"#43acff"
readonly property color appcolor_background_list:"#222222"
......@@ -57,18 +57,18 @@ QtObject{
readonly property color apptext_color_active:"white"
readonly property color apptext_color_inactive:"grey"
readonly property color apptext_color_list_active:"blue"
readonly property int appFontSize_list:12*dpRatio+settings.fontSizeMod
readonly property int appFontSize_header:15*dpRatio+settings.fontSizeMod
readonly property int appFontSize_description:11*dpRatio+settings.fontSizeMod
readonly property int appFontSize_title:14*dpRatio+settings.fontSizeMod
property int fontSize_small:10*dpRatio+settings.fontSizeMod
property int fontSize_medium:12*dpRatio+settings.fontSizeMod
property int fontSize_large:appFontSize_title+settings.fontSizeMod
property int fontSize_listItem:appFontSize_list+settings.fontSizeMod
property int fontSize_listTitle:appFontSize_title+settings.fontSizeMod
property int fontSize_listAccent:10*dpRatio+settings.fontSizeMod
readonly property int appFontSize_list:12*dpRatio
readonly property int appFontSize_header:15*dpRatio
readonly property int appFontSize_description:11*dpRatio
readonly property int appFontSize_title:14*dpRatio
property int fontSize_small:10*dpRatio
property int fontSize_medium:12*dpRatio
property int fontSize_large:appFontSize_title
property int fontSize_listItem:appFontSize_list
property int fontSize_listTitle:appFontSize_title
property int fontSize_listAccent:10*dpRatio
/* Application Navigation Bars */
readonly property string appbutton_navigationButtonHeight:manager.isProfile ? scaleY(15) : scaleY(17)
......
......@@ -147,13 +147,87 @@ StyledScreen {
GenericPopup{
title:qsTr("Screen Information")
content:Item{
Column{
anchors.fill: parent
anchors.margins: 10
spacing:10
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Screen Name: %1").arg(screenInfo.primaryScreen.screenName)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Current Orientation: %1").arg(screenInfo.primaryScreen.orientation)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Native Orientation: %1").arg(screenInfo.primaryScreen.nativeOrientation)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Logical DPI: %1").arg(screenInfo.primaryScreen.logicalDpi)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Physical DPI: %1").arg(screenInfo.primaryScreen.physicalDpi)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Height: %1 mm").arg(screenInfo.primaryScreen.heightMM)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Width: %1 mm").arg(screenInfo.primaryScreen.widthMM)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Diagonal Size: %1 (in) Screen Size:: %2").arg(screenInfo.primaryScreen.diagonalInches).arg(screenInfo.primaryScreen.stringDeviceSize)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Pixel Density Rating: %1 ").arg(screenInfo.primaryScreen.pixelDensityString)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Width: %1 (px)").arg(screenInfo.primaryScreen.width)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Height: %1 (px)").arg(screenInfo.primaryScreen.height)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Pixel Ratio: %1").arg(screenInfo.primaryScreen.pixelRatio)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Version %1").arg(orbiterVersion)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:screenInfo.primaryScreen.orientation
text:qsTr("Compile Date %1").arg(buildDate)
}
}
}
......
......@@ -206,13 +206,16 @@ StyledScreen {
text:qsTr("Width: %1 mm").arg(screenInfo.primaryScreen.widthMM)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Diagonal Size: %1 (in) Screen Size:: %2").arg(screenInfo.primaryScreen.diagonalInches).arg(screenInfo.primaryScreen.stringDeviceSize)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Pixel Density Rating: %1 ").arg(screenInfo.primaryScreen.pixelDensityString)
}
StyledText{
fontSize: Style.appFontSize_list
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Width: %1 (px)").arg(screenInfo.primaryScreen.width)
......
......@@ -293,5 +293,6 @@
<file>qml/skins/default/screens/Screen_140.qml</file>
<file>qml/skins/default/screens/Screen_244.qml</file>
<file>qml/skins/default/components/GenericOsdRemote.qml</file>
<file>qml/skins/default/+small/+xhdpi/Style.qml</file>
</qresource>
</RCC>
......@@ -2714,7 +2714,7 @@ bool qorbiterManager::createThemeStyle()
QString fp;
#ifdef NOQRC
qDebug() << "Using local path for NOQRC flag";
fp =m_localQmlPath+"skins/"+currentSkin+"/Style.qml";
fp =m_localQmlPath+"skins/"+currentSkin+"/+"+m_screenInfo->primaryScreen()->deviceSizeString()+"/Style.qml";
#else
if(m_bIsOSD)
fp ="skins/"+currentSkin+"/+md/Style.qml";
......@@ -3059,7 +3059,7 @@ void qorbiterManager::reloadQml()
qDebug() << m_appEngine->baseUrl();
qDebug() << Q_FUNC_INFO << "Current Selectors \n" << m_selector->allSelectors().join("\n\t");
QString fp ="skins/"+currentSkin+"/Style.qml";
QString fp ="skins/"+currentSkin+"/+"+m_screenInfo->primaryScreen()->deviceSizeString()+"/Style.qml";
qDebug () << Q_FUNC_INFO << selectPath(fp);
QString filePath = m_selector->select(fp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment