highlight chosen desktop, view #5

pull/2/head
axtlos 3 years ago
parent dd08aec1b2
commit d661299f65
No known key found for this signature in database
GPG Key ID: A468AFD71DD51D4A

@ -24,7 +24,7 @@ List<Desktop> desktops = const [
//imageurl: '', //imageurl: '',
), ),
Desktop( Desktop(
name: "KDE plasma", name: "KDE Plasma",
displayManager: "sddm", displayManager: "sddm",
packages: [ packages: [
"plasma", "plasma",

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jade_gui/desktops/desktops.dart'; import 'package:jade_gui/desktops/desktops.dart';
Widget desktopTemplate(desktop, setDesktop) { Widget desktopTemplate(desktop, setDesktop, currDesktop) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -19,8 +19,12 @@ Widget desktopTemplate(desktop, setDesktop) {
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
primary: Colors.white, primary: Colors.white,
backgroundColor: const Color.fromARGB(0, 169, 0, 255), backgroundColor: currDesktop.name == desktop.name
shadowColor: const Color.fromARGB(0, 169, 0, 255), ? Color.fromARGB(100, 170, 40, 255)
: Color.fromARGB(0, 170, 0, 255),
shadowColor: currDesktop.name == desktop.name
? Color.fromARGB(100, 170, 0, 255)
: Color.fromARGB(0, 170, 0, 255),
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
), ),
child: Text( child: Text(
@ -72,8 +76,8 @@ Widget desktopView(currDesktop, setDesktop, next) {
primary: false, primary: false,
child: Column( child: Column(
children: desktops children: desktops
.map<Widget>( .map<Widget>((desktop) =>
(desktop) => desktopTemplate(desktop, setDesktop)) desktopTemplate(desktop, setDesktop, currDesktop))
.toList(), .toList(),
), ),
), ),

Loading…
Cancel
Save