Commit 28a6ef22 authored by Krešimir Čohar's avatar Krešimir Čohar Committed by Filip Fila

[sddm-theme/lock screen] Remove username shadow and show clock shadow only when unfocused

Summary: This patch removes the shadow from the usernames on the login and lock screens. It also restricts the clock shadow to just the opaque (unfocused) versions of each screen.

Test Plan:
{F6648570}

{F6648571}

Reviewers: #vdg, ngraham, filipf

Reviewed By: #vdg, ngraham, filipf

Subscribers: filipf, plasma-devel

Tags: #plasma

Maniphest Tasks: T10325

Differential Revision: https://phabricator.kde.org/D19468
parent 408c6d63
......@@ -19,53 +19,31 @@
import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0
import org.kde.plasma.components 2.0
Item {
// If we're using software rendering, draw outlines instead of shadows
// See https://bugs.kde.org/show_bug.cgi?id=398317
ColumnLayout {
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
width: clock.implicitWidth
height: clock.implicitHeight
DropShadow {
id: clockShadow
visible: !softwareRendering
anchors.fill: clock
source: clock
horizontalOffset: 1
verticalOffset: 1
radius: 6
samples: 14
spread: 0.3
color: "black" // matches Breeze window decoration and desktopcontainment
Label {
text: Qt.formatTime(timeSource.data["Local"]["DateTime"])
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
font.pointSize: 48
Layout.alignment: Qt.AlignHCenter
}
ColumnLayout {
id: clock
Label {
text: Qt.formatTime(timeSource.data["Local"]["DateTime"])
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
font.pointSize: 48
Layout.alignment: Qt.AlignHCenter
}
Label {
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate)
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
font.pointSize: 24
Layout.alignment: Qt.AlignHCenter
}
DataSource {
id: timeSource
engine: "time"
connectedSources: ["Local"]
interval: 1000
}
Label {
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate)
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
font.pointSize: 24
Layout.alignment: Qt.AlignHCenter
}
DataSource {
id: timeSource
engine: "time"
connectedSources: ["Local"]
interval: 1000
}
}
......@@ -19,8 +19,6 @@
*/
import QtQuick 2.8
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
......@@ -159,19 +157,6 @@ Item {
"
}
DropShadow {
id: usernameShadow
visible: !softwareRendering
anchors.fill: usernameDelegate
source: usernameDelegate
horizontalOffset: 1
verticalOffset: 1
radius: 4
samples: 9
spread: 0.35
color: "black" // matches Breeze window decoration and desktopcontainment
}
PlasmaComponents.Label {
id: usernameDelegate
font.pointSize: theme.defaultFont.pointSize + 2
......
......@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
import QtQuick 2.6
import QtQuick 2.8
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
......@@ -30,6 +30,10 @@ import "../components"
PlasmaCore.ColorScope {
// If we're using software rendering, draw outlines instead of shadows
// See https://bugs.kde.org/show_bug.cgi?id=398317
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
Connections {
......@@ -161,6 +165,25 @@ PlasmaCore.ColorScope {
clock: clock
}
DropShadow {
id: clockShadow
anchors.fill: clock
source: clock
visible: !softwareRendering
horizontalOffset: 1
verticalOffset: 1
radius: 6
samples: 14
spread: 0.3
color: "black" // matches Breeze window decoration and desktopcontainment
Behavior on opacity {
OpacityAnimator {
duration: 1000
easing.type: Easing.InOutQuad
}
}
}
Clock {
id: clock
property Item shadow: clockShadow
......@@ -269,7 +292,7 @@ PlasmaCore.ColorScope {
state = "hidden";
}
}
states: [
State {
name: "visible"
......
......@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.2
import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.1
......@@ -31,6 +31,11 @@ import "components"
PlasmaCore.ColorScope {
id: root
// If we're using software rendering, draw outlines instead of shadows
// See https://bugs.kde.org/show_bug.cgi?id=398317
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
width: 1600
......@@ -115,9 +120,29 @@ PlasmaCore.ColorScope {
clock: clock
}
DropShadow {
id: clockShadow
anchors.fill: clock
source: clock
visible: !softwareRendering
horizontalOffset: 1
verticalOffset: 1
radius: 6
samples: 14
spread: 0.3
color: "black" // matches Breeze window decoration and desktopcontainment
Behavior on opacity {
OpacityAnimator {
duration: 1000
easing.type: Easing.InOutQuad
}
}
}
Clock {
id: clock
visible: y > 0
property Item shadow: clockShadow
y: (userListComponent.userList.y + mainStack.y)/2 - height/2
anchors.horizontalCenter: parent.horizontalCenter
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment