Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ ColumnLayout {

Label {
id: descriptionLabel
// A page with nothing to add under its title should not pay for an
// empty line; an invisible item is left out of the layout.
visible: text !== ""
Layout.fillWidth: true
color: root.descriptionColor
font.pixelSize: Math.max(14, Math.round(Qt.application.font.pointSize * 1.28))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

// A panel with rounded corners and a colour of its own. It is a Frame, and
// not a Rectangle holding anchored children, because a Frame takes its size
// from its content: with a Rectangle the content ends up taking its size from
// the panel instead, and the panel grows to whatever space is left.
Frame {
id: root

property color tint: palette.base
property color line: palette.mid
property int cornerRadius: 10

padding: 13

background: Rectangle {
color: root.tint
border.width: 1
border.color: root.line
radius: root.cornerRadius
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,44 @@ EncryptWidget QLineEdit {
EncryptWidget QLineEdit:focus {
border: 1px solid palette(highlight);
}

/* Calamares builds its confirmations - cancelling the install, closing during
* it - as plain QMessageBox instances with no object name of its own, so this
* is the only handle on them. They came up cramped and with small buttons
* beside the roomy QML pages, which is what made them look out of place.
* CalamaresWindow applies this stylesheet to itself, and the dialogs are its
* children, so these rules reach them. */
QMessageBox {
background-color: palette(window);
}

QMessageBox QLabel {
color: palette(window-text);
background-color: transparent;
font-size: 14px;
}

/* Qt gives its own children these names; the text one carries the message. */
QMessageBox QLabel#qt_msgbox_label {
/* Wide enough for the longest of these messages to keep the two
* lines its own text is written as, instead of wrapping again. */
min-width: 460px;
padding: 22px 26px 18px 14px;
}

QMessageBox QLabel#qt_msgboxex_icon_label {
padding: 20px 4px 10px 20px;
}

QMessageBox QPushButton {
/* Calamares puts a tick and a cross on these buttons, which repeat what
* the labels already say and are the only icon-theme artwork in the
* dialog, so they were the least consistent part of it.
*
* Nothing else is set here on purpose. Giving these buttons a size or a
* padding makes the widget style draw its default-button frame around the
* box while the button paints inside it, which showed up as a second
* rectangle around the default button. Leaving the geometry alone keeps
* them identical to every other button the style draws. */
icon-size: 0px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@ Page {
.replace(/BigLinux/g, Branding.string(Branding.ProductName))
}

function summaryIcon(index) {
if (index === 0) return "icons/location-content.svg"
if (index === 1) return "icons/keyboard-content.svg"
if (index === 2) return "icons/partition-content.svg"
return "icons/summary-content.svg"
// One badge per step of the summary, in that step's own colour. The order
// is the show sequence of settings.conf, which is what fills the model.
function badgeIcon(index) {
if (index === 0) return "visuals/badge-location.svg"
if (index === 1) return "visuals/badge-keyboard.svg"
if (index === 2) return "visuals/badge-partition.svg"
if (index === 3) return "visuals/badge-users.svg"
return "visuals/badge-summary.svg"
}

function badgeTint(index) {
if (index === 1) return Qt.rgba(0.55, 0.36, 0.96, 0.16)
if (index === 2) return Qt.rgba(0.13, 0.63, 0.42, 0.16)
if (index === 3) return Qt.rgba(0.91, 0.51, 0.23, 0.16)
return Qt.rgba(0.13, 0.52, 0.82, 0.16)
}

function escapeHtml(value) {
Expand Down Expand Up @@ -71,46 +81,158 @@ Page {
return String(message)
}


// Pulled from the installer's translation of the confirmation dialog it
// replaces; see the frame that uses it below.
readonly property string undoWarning: {
const source = "The %1 installer is about to make changes to your disk "
+ "in order to install %2.<br/><strong>You will not be able to "
+ "undo these changes.</strong>"
const translated = qsTranslate(
"Calamares::ViewManager",
source,
"%1 is short product name, %2 is short product name with version")
// qsTranslate hands back the source when a language has no
// translation for it, which is exactly what the dialog itself showed
// in that case, so the warning is never dropped for want of one.
const bold = /<strong>(.*?)<\/strong>/.exec(translated)
return bold ? bold[1] : translated
}

padding: 24
background: Rectangle { color: root.palette.window }

// Every colour below is the accent at a low alpha over whatever the page
// background is, so one set of values reads on the light and on the dark
// palette; a solid panel would have to be maintained twice.
readonly property color infoTint: Qt.rgba(0.13, 0.52, 0.82, 0.12)
readonly property color infoLine: Qt.rgba(0.13, 0.52, 0.82, 0.38)
readonly property color infoMark: "#2185D0"
readonly property color warnTint: Qt.rgba(0.91, 0.51, 0.13, 0.13)
readonly property color warnLine: Qt.rgba(0.91, 0.51, 0.13, 0.42)
readonly property color warnMark: "#E8833A"

ColumnLayout {
anchors.fill: parent
spacing: 12
spacing: 10

// Only the title. The sentence that used to sit under it repeated
// what the panel below already says, and every line the heading takes
// is a line the choices lose - they were losing enough of them to
// need a scroll bar.
PageHeader {
Layout.fillWidth: true
title: root.tr("Review")
description: root.tr("Check the choices below. The disks will not be changed until you confirm the installation.")
}

NativeFrame {
// Side by side: what is still safe, and what will not be undone. They
// used to be stacked, which pushed the choices themselves off screen.
RowLayout {
Layout.fillWidth: true
spacing: 12

RowLayout {
anchors.fill: parent
spacing: 12
// Both panels take the taller one's height, so they line up.
// Layout.fillHeight would do it, except that in a row inside a
// column it also makes the row itself claim the space the list
// below needs, and the list ends up with none.
readonly property real panelHeight:
Math.max(safePanel.implicitHeight, undoPanel.implicitHeight)

Image {
Layout.preferredWidth: 42
Layout.preferredHeight: 42
source: "visuals/review-shield.svg"
fillMode: Image.PreserveAspectFit
}
TintedFrame {
id: safePanel
Layout.fillWidth: true
Layout.preferredHeight: parent.panelHeight
tint: root.infoTint
line: root.infoLine

ColumnLayout {
Layout.fillWidth: true
spacing: 2
Label {
RowLayout {
anchors.fill: parent
spacing: 12

Rectangle {
Layout.preferredWidth: 34
Layout.preferredHeight: 34
Layout.alignment: Qt.AlignTop
radius: 17
color: Qt.rgba(0.13, 0.52, 0.82, 0.22)

Image {
anchors.centerIn: parent
width: 20
height: 20
source: "visuals/review-shield.svg"
sourceSize.width: width
sourceSize.height: height
fillMode: Image.PreserveAspectFit
smooth: true
}
}

ColumnLayout {
Layout.fillWidth: true
text: root.tr("Nothing will be changed until you review and confirm.")
font.weight: Font.DemiBold
wrapMode: Text.WordWrap
spacing: 2

Label {
Layout.fillWidth: true
text: root.tr("Nothing will be changed until you review and confirm.")
font.weight: Font.DemiBold
wrapMode: Text.WordWrap
}
Label {
Layout.fillWidth: true
text: root.tr("You can still go back and adjust any choice before starting the installation.")
color: root.palette.placeholderText
wrapMode: Text.WordWrap
}
}
}
}

// The warning that used to sit in the "Continue with Installation?"
// dialog. That dialog said what this page already says, so it is
// switched off in settings.conf and the one sentence worth keeping
// moved here, above the list that scrolls: below it, the warning
// could be scrolled out of sight.
//
// The sentence is borrowed from the installer's own catalogue
// rather than translated again: it is the bold half of the
// dialog's question, so the translation already exists in every
// language Calamares ships.
TintedFrame {
id: undoPanel
Layout.fillWidth: true
Layout.preferredHeight: parent.panelHeight
tint: root.warnTint
line: root.warnLine

RowLayout {
anchors.fill: parent
spacing: 12

Rectangle {
Layout.preferredWidth: 34
Layout.preferredHeight: 34
Layout.alignment: Qt.AlignTop
radius: 17
color: Qt.rgba(0.91, 0.51, 0.13, 0.22)

Image {
anchors.centerIn: parent
width: 20
height: 20
source: "visuals/status-alert.svg"
sourceSize.width: width
sourceSize.height: height
fillMode: Image.PreserveAspectFit
smooth: true
}
}

Label {
Layout.fillWidth: true
text: root.tr("You can still go back and adjust any choice before starting the installation.")
color: root.palette.placeholderText
Layout.alignment: Qt.AlignVCenter
text: root.undoWarning
font.weight: Font.DemiBold
wrapMode: Text.WordWrap
}
}
Expand All @@ -134,28 +256,41 @@ Page {
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded }

delegate: NativeFrame {
delegate: TintedFrame {
required property int index
required property string title
required property string message

width: ListView.view.width
padding: 12

RowLayout {
anchors.fill: parent
spacing: 12
spacing: 14

Image {
Layout.preferredWidth: 38
Layout.preferredHeight: 38
Rectangle {
Layout.preferredWidth: 40
Layout.preferredHeight: 40
Layout.alignment: Qt.AlignTop
source: root.summaryIcon(index)
fillMode: Image.PreserveAspectFit
smooth: true
radius: 20
color: root.badgeTint(index)

Image {
anchors.centerIn: parent
width: 22
height: 22
source: root.badgeIcon(index)
sourceSize.width: width
sourceSize.height: height
fillMode: Image.PreserveAspectFit
smooth: true
}
}

ColumnLayout {
Layout.fillWidth: true
spacing: 4

Label {
Layout.fillWidth: true
text: title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ Page {
.replace(/BigLinux/g, Branding.string(Branding.ProductName))
}

function initials(name) {
var parts = String(name).trim().split(/\s+/)
if (!parts.length || parts[0] === "") return "?"
if (parts.length === 1) return parts[0].charAt(0).toUpperCase()
return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase()
}

padding: 20
background: Rectangle { color: root.palette.window }
Expand Down Expand Up @@ -307,12 +301,20 @@ Page {
radius: 46
color: root.palette.highlight

Label {
// The avatar stays the symbolic user glyph whatever
// the name is. It used to be the initials, falling
// back to a question mark while the field was empty,
// and that question mark read as an error rather than
// as a field still to fill.
Image {
anchors.centerIn: parent
text: root.initials(config.fullName)
color: root.palette.highlightedText
font.pixelSize: 30
font.weight: Font.DemiBold
width: 46
height: width
source: "icons/users.svg"
sourceSize.width: width
sourceSize.height: height
fillMode: Image.PreserveAspectFit
smooth: true
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ sequence:
- finishedq

branding: bigcommunity
prompt-install: true
# The summary page carries the warning this prompt used to show, so the
# extra dialog only repeated what was already on screen.
prompt-install: false
dont-chroot: false
oem-setup: false
disable-cancel: false
Expand Down
Loading
Loading