mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-16 15:58:11 +00:00
Singleton for future style definition. For now, put the fonts there
This commit is contained in:
parent
50eafab5dc
commit
9819e63fcc
4 changed files with 16 additions and 11 deletions
|
@ -26,8 +26,9 @@
|
||||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.5
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
|
import "." 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: button
|
id: button
|
||||||
|
@ -60,15 +61,6 @@ Rectangle {
|
||||||
property bool present: !under || under.checked || checked || under.numSelectedChildren > 0
|
property bool present: !under || under.checked || checked || under.numSelectedChildren > 0
|
||||||
height: present ? ((appWindow.height >= 800) ? 44 * scaleRatio : 52 * scaleRatio ) : 0
|
height: present ? ((appWindow.height >= 800) ? 44 * scaleRatio : 52 * scaleRatio ) : 0
|
||||||
|
|
||||||
// Load custom fonts @TODO: should probably do this somewhere else
|
|
||||||
Text {
|
|
||||||
FontLoader { id: sfuid; source: "../fonts/SFUIDisplay-Bold.otf"; }
|
|
||||||
FontLoader { source: "../fonts/SFUIDisplay-Medium.otf"; }
|
|
||||||
FontLoader { source: "../fonts/SFUIDisplay-Light.otf"; }
|
|
||||||
FontLoader { source: "../fonts/SFUIDisplay-Regular.otf"; }
|
|
||||||
font.family: "SFUIDisplay";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Button gradient whilst checked
|
// Button gradient whilst checked
|
||||||
// @TODO: replace by .png - gradient not available in 2d renderer
|
// @TODO: replace by .png - gradient not available in 2d renderer
|
||||||
LinearGradient {
|
LinearGradient {
|
||||||
|
@ -115,7 +107,7 @@ Rectangle {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.right
|
anchors.left: parent.right
|
||||||
anchors.leftMargin: 8 * scaleRatio
|
anchors.leftMargin: 8 * scaleRatio
|
||||||
font.family: "SFUIDisplay"
|
font.family: Style.fontMedium.name
|
||||||
font.bold: true
|
font.bold: true
|
||||||
font.pixelSize: 16 * scaleRatio
|
font.pixelSize: 16 * scaleRatio
|
||||||
color: "#FFFFFF"
|
color: "#FFFFFF"
|
||||||
|
|
10
components/Style.qml
Normal file
10
components/Style.qml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
property QtObject fontMedium: FontLoader { id: _fontMedium; source: "qrc:/fonts/SFUIDisplay-Medium.otf"; }
|
||||||
|
property QtObject fontBold: FontLoader { id: _fontBold; source: "qrc:/fonts/SFUIDisplay-Bold.otf"; }
|
||||||
|
property QtObject fontLight: FontLoader { id: _fontLight; source: "qrc:/fonts/SFUIDisplay-Light.otf"; }
|
||||||
|
property QtObject fontRegular: FontLoader { id: _fontRegular; source: "qrc:/fonts/SFUIDisplay-Regular.otf"; }
|
||||||
|
}
|
1
components/qmldir
Normal file
1
components/qmldir
Normal file
|
@ -0,0 +1 @@
|
||||||
|
singleton Style 1.0 Style.qml
|
2
qml.qrc
2
qml.qrc
|
@ -182,5 +182,7 @@
|
||||||
<file>fonts/SFUIDisplay-Regular.otf</file>
|
<file>fonts/SFUIDisplay-Regular.otf</file>
|
||||||
<file>fonts/SFUIDisplay-Light.otf</file>
|
<file>fonts/SFUIDisplay-Light.otf</file>
|
||||||
<file>fonts/SFUIDisplay-Bold.otf</file>
|
<file>fonts/SFUIDisplay-Bold.otf</file>
|
||||||
|
<file>components/Style.qml</file>
|
||||||
|
<file>components/qmldir</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Loading…
Reference in a new issue