Code Monkey home page Code Monkey logo

sddm-astronaut-theme's Issues

AccentColor issue

Screenshot_20240602_230418

The text color of password/username when focused and typing is hard to see. Changing AccentColor to white fixes this but it also changes hover color for user/session selection. Is there a way to decouple them?

Problem with config syntax

Would you have any idea why the text is stuck as black? I've tried setting it to white in theme.conf. I've also tried messing with the Main.qml, but nothing seems to work.

I'm on Endeavour OS with Gnome. (DE shouldn't matter, right?)

I'm attaching my theme.conf and Main.qml. Thank you for looking!

theme.conf

[General]
Background="background.png"
DimBackgroundImage="0.4"
ScaleImageCropped="true"
ScreenWidth="1920"
ScreenHeight="1080"

[Blur Settings]
FullBlur="false"
PartialBlur="true"
BlurRadius="80"

[Design Customizations]
HaveFormBackground="true"
FormPosition="center"
BackgroundImageHAlignment="center"
BackgroundImageVAlignment="center"

#########
## Colors
#########

MainColor="#ffffff"
AccentColor="#ffffff"
OverrideTextFieldColor="#ffffff"
BackgroundColor="#21222C"
placeholderColor="#ffffff"
IconColor="#ffffff"
OverrideLoginButtonTextColor="#ffffff"

InterfaceShadowSize="3"
InterfaceShadowOpacity="0.6"
RoundCorners="12"
ScreenPadding="0"
Font="Open Sans"
FontSize=""
HideLoginButton="true"

[Interface Behavior]
ForceRightToLeft="false"
ForceLastUser="true"
ForcePasswordFocus="true"
ForceHideCompletePassword="false"
ForceHideVirtualKeyboardButton="true"
ForceHideSystemButtons="false"
AllowEmptyPassword="false"
AllowBadUsernames="false"

[Locale Settings]
Locale=""
HourFormat="HH:mm"
DateFormat="dddd d MMMM"

Main.qml

import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import Qt5Compat.GraphicalEffects
import "Components"

Pane {
    id: root

    height: config.ScreenHeight || Screen.height
    width: config.ScreenWidth || Screen.width

    LayoutMirroring.enabled: config.ForceRightToLeft == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft
    LayoutMirroring.childrenInherit: true

    padding: config.ScreenPadding
    palette.button: "transparent"
    palette.highlight: config.AccentColor
    palette.highlightedText: config.OverrideTextFieldColor !== "" ? config.OverrideTextFieldColor : root.palette.highlight
    palette.text: config.MainColor
    palette.buttonText: config.MainColor
    palette.window: config.BackgroundColor

    font.family: config.Font
    font.pointSize: config.FontSize !== "" ? config.FontSize : parseInt(height / 80)
    focus: true

    property bool leftleft: config.HaveFormBackground == "true" &&
                            config.PartialBlur == "false" &&
                            config.FormPosition == "left" &&
                            config.BackgroundImageHAlignment == "left"

    property bool leftcenter: config.HaveFormBackground == "true" &&
                              config.PartialBlur == "false" &&
                              config.FormPosition == "left" &&
                              config.BackgroundImageHAlignment == "center"

    property bool rightright: config.HaveFormBackground == "true" &&
                              config.PartialBlur == "false" &&
                              config.FormPosition == "right" &&
                              config.BackgroundImageHAlignment == "right"

    property bool rightcenter: config.HaveFormBackground == "true" &&
                               config.PartialBlur == "false" &&
                               config.FormPosition == "right" &&
                               config.BackgroundImageHAlignment == "center"

    Item {
        id: sizeHelper

        anchors.fill: parent
        height: parent.height
        width: parent.width

        Rectangle {
            id: tintLayer
            anchors.fill: parent
            width: parent.width
            height: parent.height
            color: "black"
            opacity: config.DimBackgroundImage
            z: 1
        }

        Image {
            id: backgroundImage

            anchors.fill: parent
            source: "file:///usr/share/sddm/themes/sebastian-theme/background.png"
            fillMode: config.ScaleImageCropped == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
            asynchronous: true
            cache: true
            clip: true
            mipmap: true
        }

        ShaderEffectSource {
            id: blurMask

            sourceItem: backgroundImage
            width: parent.width
            height: parent.height
            anchors.centerIn: parent
            visible: config.FullBlur == "true" || config.PartialBlur == "true"
        }

        GaussianBlur {
            id: blur

            anchors.fill: parent
            source: blurMask
            radius: config.BlurRadius
            samples: config.BlurRadius * 2 + 1
            cached: true
            visible: config.FullBlur == "true" || config.PartialBlur == "true"
        }

        Rectangle {
            id: formBackground
            anchors.fill: form
            anchors.centerIn: form
            color: root.palette.window
            visible: config.HaveFormBackground == "true"
            opacity: config.PartialBlur == "true" ? 0.3 : 1
            z: 2
        }

        LoginForm {
            id: form

            height: virtualKeyboard.state == "visible" ? parent.height - virtualKeyboard.implicitHeight : parent.height
            width: parent.width / 2.5
            anchors.centerIn: parent
            virtualKeyboardActive: virtualKeyboard.state == "visible"
            z: 3
        }

        Button {
            id: vkb
            onClicked: virtualKeyboard.switchState()
            visible: virtualKeyboard.status == Loader.Ready && config.ForceHideVirtualKeyboardButton == "false"
            anchors.bottom: parent.bottom
            anchors.bottomMargin: implicitHeight
            anchors.horizontalCenter: form.horizontalCenter
            z: 4
            contentItem: Text {
                text: config.TranslateVirtualKeyboardButton || "Virtual Keyboard"
                color: parent.visualFocus ? palette.highlight : palette.text
                font.pointSize: root.font.pointSize * 0.8
            }
            background: Rectangle {
                id: vkbbg
                color: "transparent"
            }
        }

        Loader {
            id: virtualKeyboard
            source: "Components/VirtualKeyboard.qml"
            state: "hidden"
            property bool keyboardActive: item ? item.active : false
            onKeyboardActiveChanged: keyboardActive ? state = "visible" : state = "hidden"
            width: parent.width
            z: 1
            function switchState() { state = state == "hidden" ? "visible" : "hidden" }
            states: [
                State {
                    name: "visible"
                    PropertyChanges {
                        target: form
                        systemButtonVisibility: false
                        clockVisibility: false
                    }
                    PropertyChanges {
                        target: virtualKeyboard
                        y: root.height - virtualKeyboard.height
                        opacity: 1
                    }
                },
                State {
                    name: "hidden"
                    PropertyChanges {
                        target: virtualKeyboard
                        y: root.height - root.height/4
                        opacity: 0
                    }
                }
            ]
            transitions: [
                Transition {
                    from: "hidden"
                    to: "visible"
                    SequentialAnimation {
                        ScriptAction {
                            script: {
                                virtualKeyboard.item.activated = true;
                                Qt.inputMethod.show();
                            }
                        }
                        ParallelAnimation {
                            NumberAnimation {
                                target: virtualKeyboard
                                property: "y"
                                duration: 100
                                easing.type: Easing.OutQuad
                            }
                            OpacityAnimator {
                                target: virtualKeyboard
                                duration: 100
                                easing.type: Easing.OutQuad
                            }
                        }
                    }
                },
                Transition {
                    from: "visible"
                    to: "hidden"
                    SequentialAnimation {
                        ParallelAnimation {
                            NumberAnimation {
                                target: virtualKeyboard
                                property: "y"
                                duration: 100
                                easing.type: Easing.InQuad
                            }
                            OpacityAnimator {
                                target: virtualKeyboard
                                duration: 100
                                easing.type: Easing.InQuad
                            }
                        }
                        ScriptAction {
                            script: {
                                Qt.inputMethod.hide();
                            }
                        }
                    }
                }
            ]
        }

        MouseArea {
            anchors.fill: backgroundImage
            onClicked: parent.forceActiveFocus()
        }

        // Ensure other text elements use MainColor
        Component.onCompleted: {
            form.color = config.MainColor;
            vkb.color = config.MainColor;
        }
    }
}

OverrideTextFieldColor is always black

If you set
OverrideTextFieldColor=""
then selected text always has the same color as AccentColor and is impossible to read.

If you set OverrideTextFieldColor to anything, e.g.
OverrideTextFieldColor="#123456"
then selected text is always black.

theme not working

when i previewing the theme SDDM shows me this error:
2024-05-21-235528_hyprshot
when i reboot or run it through terminal its just default theme without errors

change default AccentColor

I am aware this can be configured but I find the default AccentColor very hard to read. Especially if you move the form to the left

image

#8a73a1 works quite well and also looks a bit nicer. I was wondering whether we could make that a default?

Here's a screenshot:
image

Old default with the form in the center:
image

With the form in the center:
image

The one with the form in the center doesn't contrast the image as much, but that doesn't really matter because it's different from the dark input form field

(this)
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.