From 06dc0404c017077dff611e034e566e2ed8f81ef6 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Fri, 18 Jan 2019 11:23:44 +0100 Subject: Media sources: automatic width of first column --- qml/mw-ui.qml | 166 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 97 insertions(+), 69 deletions(-) (limited to 'qml/mw-ui.qml') diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml index 834708c..69e122f 100644 --- a/qml/mw-ui.qml +++ b/qml/mw-ui.qml @@ -113,25 +113,31 @@ Rectangle { Layout.margins: 10 text: qsTr("Mageia official repositories contain:"); color: "white" } - Rectangle {id: coreBg + Button {id: coreBg Layout.margins: 5 - LinearGradient { - anchors.fill: parent - start: Qt.point(0, 0) - end: Qt.point(0, 20) - gradient: Gradient { - GradientStop { position: 0.0; color: "lightgreen" } - GradientStop { position: 1.0; color: "green" } - } - } - width: 90; - height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true - Label { - anchors.centerIn: parent - //: Should be as displayed in software manager, thus in general not translated - text: qsTr("core"); font.bold: true; } + //height: Qt.application.font.pixelSize * 1.3 + style: ButtonStyle { + label: Label { + horizontalAlignment: TextInput.AlignHCenter + //: Should be as displayed in software manager, thus in general not translated + text: qsTr("core"); + font.bold: true; color: "black"; + } + background: Rectangle { + LinearGradient { + anchors.fill: parent + start: Qt.point(0, 0) + end: Qt.point(0, 20) + gradient: Gradient { + GradientStop { position: 0.0; color: "lightgreen" } + GradientStop { position: 1.0; color: "green" } + } + } + } + + } } Label { text: qsTr("- the free-open-source packages"); @@ -139,27 +145,31 @@ Rectangle { Layout.maximumWidth: slideshow.width -20 - coreBg.width color: "white" } - - Rectangle {id: nonfreeBg + Button { Layout.margins: 5 - LinearGradient { - anchors.fill: parent - start: Qt.point(0, 0) - end: Qt.point(0, 20) - gradient: Gradient { - GradientStop { position: 0.0; color: "red" } - GradientStop { position: 1.0; color: "darkred" } - } - } - height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true - Label { - anchors.centerIn: parent - //: Should be as displayed in software manager, thus in general not translated - text: qsTr("nonfree"); font.bold: true; - color: "white"} + style: ButtonStyle { + label: Label { + horizontalAlignment: TextInput.AlignHCenter + //: Should be as displayed in software manager, thus in general not translated + text: qsTr("nonfree"); + font.bold: true; color: "white"; + } + background: Rectangle { + LinearGradient { + anchors.fill: parent + start: Qt.point(0, 0) + end: Qt.point(0, 20) + gradient: Gradient { + GradientStop { position: 0.0; color: "red" } + GradientStop { position: 1.0; color: "darkred" } + } + } + } + } + } Label { width: parent.width text: qsTr("- closed-source programs, e.g. Nvidia proprietary drivers, non-free drivers for some Wi-Fi cards, etc"); @@ -167,50 +177,62 @@ Rectangle { wrapMode: Text.WordWrap color: "white" } - Rectangle {id: taintedBg + Button { Layout.margins: 5 - LinearGradient { - anchors.fill: parent - start: Qt.point(0, 0) - end: Qt.point(0, 20) - gradient: Gradient { - GradientStop { position: 0.0; color: "red" } - GradientStop { position: 1.0; color: "darkred" } - } - } - height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true - Label { - anchors.centerIn: parent - //: Should be as displayed in software manager, thus in general not translated - text: qsTr("tainted"); font.bold: true; - color: "white" } + style: ButtonStyle { + label: Label { + horizontalAlignment: TextInput.AlignHCenter + //: Should be as displayed in software manager, thus in general not translated + text: qsTr("tainted"); + font.bold: true; color: "white"; + } + background: Rectangle { + LinearGradient { + anchors.fill: parent + start: Qt.point(0, 0) + end: Qt.point(0, 20) + gradient: Gradient { + GradientStop { position: 0.0; color: "red" } + GradientStop { position: 1.0; color: "darkred" } + } + } + } + } + } Label { text: qsTr("- these packages (eg audio and video codecs needed for certain multimedia files or commercial DVDs) may infringe on patents or copyright laws in certain countries. "); wrapMode: Text.WordWrap Layout.maximumWidth: slideshow.width -110 color: "white" } - Rectangle {id: backports + Button { Layout.margins: 5 - LinearGradient { - anchors.fill: parent - start: Qt.point(0, 0) - end: Qt.point(0, 20) - gradient: Gradient { - GradientStop { position: 0.0; color: "lightgray" } - GradientStop { position: 1.0; color: "darkgray" } - } - } - height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true - Label { anchors.centerIn: parent - //: Should be as displayed in software manager, thus in general not translated - text: qsTr("backports"); font.bold: true; } + style: ButtonStyle { + label: Label { + horizontalAlignment: TextInput.AlignHCenter + //: Should be as displayed in software manager, thus in general not translated + text: qsTr("backports"); + font.bold: true; color: "black"; + } + background: Rectangle { + LinearGradient { + anchors.fill: parent + start: Qt.point(0, 0) + end: Qt.point(0, 20) + gradient: Gradient { + GradientStop { position: 0.0; color: "lightgray" } + GradientStop { position: 1.0; color: "darkgray" } + } + } + } + } + } Label { text: qsTr("- includes software published after a Mageia release, or another version of software already present and not replaced."); wrapMode: Text.WordWrap @@ -232,16 +254,22 @@ Rectangle { } } } - Rectangle {id: noteBg + Button { Layout.margins: 5 - color: "#e6c200"; - height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true - Label { anchors.centerIn: parent - text: qsTr("Note! "); font.bold: true; + style: ButtonStyle { + label: Label { + horizontalAlignment: TextInput.AlignHCenter + text: qsTr("Note! "); + font.bold: true; color: "black"; + } + background: Rectangle { + color: "#e6c200"; + } + } - } + } Label { text: qsTr("If you enabled the online repositories during installation, some media sources should be installed already. Otherwise, we will now configure these online repositories. If this computer will have access to the Internet, you can delete the cdrom entry from the list of repositories.")+"

"+ qsTr("Now, please enable or disable the online repositories of your choice: click on the Edit software repositories button. Select at least the release and updates pair. Debug and Testing are for special cases.")+"
"+ -- cgit v1.2.1