diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..f59ec20a --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/src/stack.ts b/src/stack.ts index c915be45..68ff83a6 100644 --- a/src/stack.ts +++ b/src/stack.ts @@ -5,8 +5,8 @@ import type { Entity } from './ecs'; import type { Ext } from './extension'; import type { ShellWindow } from './window'; -import * as Ecs from 'ecs'; import * as a from 'arena'; +import * as Ecs from 'ecs'; import * as utils from 'utils'; const Arena = a.Arena; @@ -34,25 +34,26 @@ interface StackWidgets { function stack_widgets_new(): StackWidgets { let tabs = new St.BoxLayout({ style_class: 'pop-shell-stack', - x_expand: true + pack_start: true, + x_expand: false }); - tabs.get_layout_manager()?.set_homogeneous(true); + // tabs.get_layout_manager()?.set_homogeneous(true); return { tabs }; } -const ContainerButton = GObject.registerClass({ - Signals: { 'activate': {} }, -}, class ImageButton extends St.Button { - _init(icon: St.Icon) { - super._init({ - child: icon, - x_expand: true, - y_expand: true, - }) - } -}) +// const ContainerButton = GObject.registerClass({ +// Signals: { 'activate': {} }, +// }, class ImageButton extends St.Button { +// _init(icon: St.Icon) { +// super._init({ +// child: icon, +// x_expand: true, +// y_expand: true, +// }) +// } +// }) interface TabButton extends St.Button { set_title: (title: string) => void; @@ -62,49 +63,22 @@ const TabButton = GObject.registerClass({ Signals: { 'activate': {} }, }, class TabButton extends St.Button { _init(window: ShellWindow) { - const icon = window.icon(window.ext, 24) - icon.set_x_align(Clutter.ActorAlign.START) - - const label = new St.Label({ - y_expand: true, - x_align: Clutter.ActorAlign.START, - y_align: Clutter.ActorAlign.CENTER, - style: "padding-left: 8px" - }) - - label.text = window.title() + const icon = window.icon(window.ext, TAB_HEIGHT) + icon.set_x_align(Clutter.ActorAlign.CENTER) const container = new St.BoxLayout({ y_expand: true, - y_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.START }) - const close_button = new ContainerButton(new St.Icon({ - icon_name: 'window-close-symbolic', - icon_size: 24, - y_align: Clutter.ActorAlign.CENTER, - })) - - close_button.connect('clicked', () => { - window.meta.delete(global.get_current_time()) - }) - - close_button.set_x_align(Clutter.ActorAlign.END) - close_button.set_y_align(Clutter.ActorAlign.CENTER) - container.add_actor(icon) - container.add_actor(label) - container.add_actor(close_button) super._init({ child: container, - x_expand: true, + x_expand: false, y_expand: true, - y_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.START, }) - - - this._title = label } set_title(text: string) {