From 49016b84c6dbb58a268567589848dc78d14e84e0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 22 Sep 2022 18:36:55 +0200 Subject: [PATCH] Add tab icons --- lib/home/home_page.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index a7e237ba..10ec433f 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -4,6 +4,7 @@ import 'package:context_menu/context_menu.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:lxd_service/lxd_service.dart'; +import 'package:lxd_x/lxd_x.dart'; import 'package:movable_tabs/movable_tabs.dart'; import 'package:provider/provider.dart'; import 'package:ubuntu_service/ubuntu_service.dart'; @@ -11,6 +12,7 @@ import 'package:ubuntu_service/ubuntu_service.dart'; import '../instances/instance_view.dart'; import '../launcher/launcher_wizard.dart'; import '../terminal/terminal_page.dart'; +import '../widgets/product_logo.dart'; import 'home_menu.dart'; import 'home_model.dart'; @@ -64,13 +66,15 @@ class HomePage extends StatelessWidget { selected: index == model.currentIndex, onPressed: () => model.currentIndex = index, onClosed: () => model.closeTab(index), - label: terminal.maybeWhen( - running: (instance, running) => AnimatedBuilder( - animation: running, - builder: (context, child) { - return Text(running.title ?? instance.name); - }, + icon: terminal.maybeWhen( + none: () => null, + orElse: () => ProductLogo.asset( + name: terminal.instance?.os, + size: 32, ), + ), + label: terminal.maybeWhen( + running: (instance, running) => Text(instance.name), orElse: () => const Text('Home'), ), );