launcher: fix files flicker on change to empty

Also no need for window halign and valign
This commit is contained in:
2 * r + 2 * t 2025-01-15 15:25:53 +11:00
parent dcd914dbae
commit cd2c60f061

View file

@ -278,7 +278,6 @@ const Results = ({ entry, mode }: { entry: Widget.Entry; mode: Variable<Mode> })
.finally(updateEmpty); .finally(updateEmpty);
self.hook(entry, "activate", () => { self.hook(entry, "activate", () => {
if (!entry.text) return;
if (mode.get() === "math") { if (mode.get() === "math") {
if (entry.text.startsWith("clear")) Math.get_default().clear(); if (entry.text.startsWith("clear")) Math.get_default().clear();
else Math.get_default().commit(); else Math.get_default().commit();
@ -289,7 +288,7 @@ const Results = ({ entry, mode }: { entry: Widget.Entry; mode: Variable<Mode> })
if (!entry.text && mode.get() === "apps") return; if (!entry.text && mode.get() === "apps") return;
// Files has delay cause async so it does some stuff by itself // Files has delay cause async so it does some stuff by itself
const ignoreFileAsync = !entry.text || entry.text.startsWith(">") || mode.get() !== "files"; const ignoreFileAsync = entry.text.startsWith(">") || mode.get() !== "files";
if (ignoreFileAsync) self.foreach(ch => ch.destroy()); if (ignoreFileAsync) self.foreach(ch => ch.destroy());
if (entry.text.startsWith(">")) { if (entry.text.startsWith(">")) {
@ -372,8 +371,6 @@ export default class Launcher extends Widget.Window {
return true; return true;
} }
}, },
halign: Gtk.Align.CENTER,
valign: Gtk.Align.START,
child: <LauncherContent mode={mode} showResults={showResults} entry={entry} />, child: <LauncherContent mode={mode} showResults={showResults} entry={entry} />,
}) })
); );