// SPDX-FileCopyrightText: 2026 Matvey Shcherbinin // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL import QtQuick import QtQuick.Layouts import org.kde.kirigami as Kirigami import org.kde.kirigamiaddons.formcard as FormCard import koutnet.app // A form card painted in the window's own palette rather than in the one the // controls style brings with it. // // The card every form is made of is the largest surface in the application: a // settings page is five or six of them, and a page that is half cards is a page // whose colour is the controls style's rather than the theme's. A wallpaper // picked in the settings is then everywhere except on the cards, which is the // one place it is meant to be seen. // // The card is raised a step off the page behind it rather than filled with the // page's own colour, and the step is the one ThemePalette keeps for it: a card // that was the same colour as its background would be an outline with words in // it, which is what a form card was invented to stop being. // // The gutter is here rather than at the two dozen places a card is written, // because it is the answer to a question about the page rather than about the // card: the form is one column and it is on the left. A column centred in a // window the width of a desktop monitor is a column floating in the middle of a // screen, and however wide it is made it still reads as an object dropped there // rather than as a page with an edge. FormCard.FormCard { // The card paints itself out of the theme colours of whatever item holds it, // and it starts a chain of its own so that a card in a dark sheet is a dark // card. Naming the colours here is what puts the theme in them: the chain // this card starts is seeded from the window's palette rather than from the // desktop's, and everything drawn in it - the card, the labels in it, the // line under a focused field - comes out of the wallpaper instead of out of // the controls style. Kirigami.Theme.colorSet: Kirigami.Theme.View Kirigami.Theme.backgroundColor: ThemePalette.surfaceCard Kirigami.Theme.textColor: ThemePalette.text Kirigami.Theme.disabledTextColor: Kirigami.ColorUtils.linearInterpolation(ThemePalette.text, ThemePalette.surfaceCard, 0.4) Kirigami.Theme.highlightColor: ThemePalette.accent Kirigami.Theme.highlightedTextColor: ThemePalette.accentText readonly property real gutter: Kirigami.Units.gridUnit Layout.leftMargin: gutter Layout.rightMargin: gutter }