Skip to content

Commit bda5037

Browse files
committed
fix:[#875] move output behind button
- increase size of output box - hide output box behind "view output" button
1 parent 97404d2 commit bda5037

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

src/view/action_page.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use crate::utils;
1414
use crate::view;
1515

1616
const ACTION_CANCEL: &str = "action-page.cancel";
17+
const ACTION_VIEW_OUTPUT: &str = "action-page.view-output";
1718
const ACTION_VIEW_ARTIFACT: &str = "action-page.view-artifact";
1819
const ACTION_RETRY: &str = "action-page.retry";
1920

@@ -32,6 +33,8 @@ mod imp {
3233
pub(super) status_page: TemplateChild<adw::StatusPage>,
3334
#[template_child]
3435
pub(super) view_artifact_button: TemplateChild<gtk::Button>,
36+
#[template_child]
37+
pub(super) output_box: TemplateChild<adw::Clamp>,
3538
}
3639

3740
#[glib::object_subclass]
@@ -43,6 +46,9 @@ mod imp {
4346
fn class_init(klass: &mut Self::Class) {
4447
klass.bind_template();
4548
klass.install_action(ACTION_CANCEL, None, |widget, _, _| widget.cancel());
49+
klass.install_action(ACTION_VIEW_OUTPUT, None, |widget, _, _| {
50+
widget.view_output()
51+
});
4652
klass.install_action(ACTION_VIEW_ARTIFACT, None, |widget, _, _| {
4753
widget.view_artifact();
4854
});
@@ -289,6 +295,14 @@ impl ActionPage {
289295
}
290296
}
291297

298+
fn view_output(&self) {
299+
let imp = self.imp();
300+
imp.status_page.set_icon_name(None);
301+
imp.status_page.set_description(None);
302+
imp.output_box.set_visible(true);
303+
self.action_set_enabled(ACTION_VIEW_OUTPUT, false);
304+
}
305+
292306
fn view_artifact(&self) {
293307
match self.action().as_ref().and_then(model::Action::artifact) {
294308
Some(artifact) => {

src/view/action_page.ui

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<property name="mode">horizontal</property>
66
<widgets>
77
<widget name="abort_button"/>
8+
<widget name="view_output_button"/>
89
<widget name="view_artifact_button"/>
910
</widgets>
1011
</object>
@@ -40,10 +41,14 @@
4041
<child>
4142
<object class="AdwClamp">
4243
<property name="margin-bottom">9</property>
44+
<property name="orientation">vertical</property>
4345

4446
<child>
45-
<object class="AdwClamp">
47+
<object class="AdwClamp" id="output_box">
4648
<property name="orientation">vertical</property>
49+
<property name="height-request">220</property>
50+
<property name="visible">False</property>
51+
4752

4853
<property name="child">
4954
<object class="AdwBin">
@@ -92,6 +97,21 @@
9297
</object>
9398
</child>
9499

100+
<child>
101+
<object class="GtkButton" id="view_output_button">
102+
<style>
103+
<class name="pill"/>
104+
</style>
105+
<property name="action-name">action-page.view-output</property>
106+
<property name="halign">center</property>
107+
<property name="label" translatable="yes">_View Output</property>
108+
<property name="use-underline">True</property>
109+
<property name="visible" bind-source="view_output_button" bind-property="sensitive" bind-flags="sync-create"/>
110+
<property name="width-request">200</property>
111+
<property name="visible">True</property>
112+
</object>
113+
</child>
114+
95115
<child>
96116
<object class="GtkButton" id="abort_button">
97117
<style>

0 commit comments

Comments
 (0)