Skip to content

Commit

Permalink
Add tab icons
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnurmi committed Sep 22, 2022
1 parent 47b5dcd commit 49016b8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ 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';

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';

Expand Down Expand Up @@ -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'),
),
);
Expand Down

0 comments on commit 49016b8

Please sign in to comment.