forked from qtproject/qt-apps-neptune-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a new AutoMain.qml for auto-adapting to the screen resolution
Change-Id: I37eb367d484bdbe71c1626a9a650b4afaef92045 Reviewed-by: Nedim Hadzic <[email protected]>
- Loading branch information
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2016 Pelagicore AG | ||
** Contact: http://www.qt.io/ or http://www.pelagicore.com/ | ||
** | ||
** This file is part of the Neptune IVI UI. | ||
** | ||
** $QT_BEGIN_LICENSE:GPL3-PELAGICORE$ | ||
** Commercial License Usage | ||
** Licensees holding valid commercial Pelagicore Neptune IVI UI | ||
** licenses may use this file in accordance with the commercial license | ||
** agreement provided with the Software or, alternatively, in accordance | ||
** with the terms contained in a written agreement between you and | ||
** Pelagicore. For licensing terms and conditions, contact us at: | ||
** http://www.pelagicore.com. | ||
** | ||
** GNU General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU | ||
** General Public License version 3 as published by the Free Software | ||
** Foundation and appearing in the file LICENSE.GPLv3 included in the | ||
** packaging of this file. Please review the following information to | ||
** ensure the GNU General Public License version 3 requirements will be | ||
** met: http://www.gnu.org/licenses/gpl-3.0.html. | ||
** | ||
** $QT_END_LICENSE$ | ||
** | ||
** SPDX-License-Identifier: GPL-3.0 | ||
** | ||
****************************************************************************/ | ||
|
||
import QtQuick 2.1 | ||
import QtQuick.Window 2.2 | ||
import "sysui" | ||
import controls 1.0 | ||
import utils 1.0 | ||
|
||
Rectangle { | ||
id: root | ||
|
||
color: "black" | ||
width: Screen.width | ||
height: Screen.height | ||
|
||
Item { | ||
width: Screen.width | ||
height: width * 0.62 | ||
|
||
onWidthChanged: Style.cellWidth = Math.floor(width/24) | ||
onHeightChanged: Style.cellHeight = Math.floor(height/24) | ||
|
||
Component.onCompleted: { | ||
Style.cellWidth = Math.floor(width/24) | ||
Style.cellHeight = Math.floor(height/24) | ||
Style.defaultSymbolSize = Style.symbolSizeM | ||
Style.defaultGfxSize = 2 | ||
|
||
var scalFactor = (width/1280); | ||
|
||
Style.fontSizeXXS = scalFactor * 14 | ||
|
||
Style.fontSizeXS = scalFactor * 16 | ||
|
||
Style.fontSizeS = scalFactor * 18 | ||
|
||
Style.fontSizeM = scalFactor * 24 | ||
|
||
Style.fontSizeL = scalFactor * 28 | ||
|
||
Style.fontSizeXL = scalFactor * 36 | ||
|
||
Style.fontSizeXXL = scalFactor * 48 | ||
|
||
Style.fontWeight = Font.Light | ||
} | ||
|
||
DisplayBackground { | ||
anchors.fill: display | ||
background: "background_1920x1080" | ||
} | ||
|
||
Display { | ||
id: display | ||
anchors.fill: parent | ||
} | ||
|
||
DisplayGrid { | ||
anchors.fill: display | ||
} | ||
} | ||
} |