Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Re #10: Realign widgets
Browse files Browse the repository at this point in the history
Now that we have top and bottom buttons, the alignment is better
if images, completion check marks and progress bars are centralised
  • Loading branch information
IBBoard committed Aug 15, 2020
1 parent c53b939 commit 81b5f5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/widgets/AddImageButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ class AddImageButton : Gtk.Button {

if (draw_width > 0 && draw_height > 0) {
ct.scale (scale, scale);
ct.set_source_surface (this.surface, 0, 0);
ct.set_source_surface (this.surface, (widget_width - draw_width) / 2 / scale, (widget_height - draw_height) / 2 / scale);
ct.fill ();
}
ct.restore ();

style_context.render_check (ct,
(draw_width / 2.0) - (ICON_SIZE / 2.0),
(draw_height / 2.0) - (ICON_SIZE / 2.0),
(widget_width / 2.0) - (ICON_SIZE / 2.0),
(widget_height / 2.0) - (ICON_SIZE / 2.0),
ICON_SIZE,
ICON_SIZE);
}
Expand Down
3 changes: 1 addition & 2 deletions src/widgets/ComposeImageManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ class ComposeImageManager : Gtk.Container {
bar.show_all ();
this.progress_bars.add (bar);

// Add the progress bar first so it (should) go under the image description button
var desc_btn = new Gtk.Button.from_icon_name("cawbird-compose-symbolic");
desc_btn.set_parent(this);
desc_btn.get_style_context ().add_class ("image-button");
Expand Down Expand Up @@ -255,7 +254,7 @@ class ComposeImageManager : Gtk.Container {
bar.get_preferred_width (out bar_allocation.width, out n);
bar_allocation.width = int.max (button_width - 12, bar_allocation.width);
bar.get_preferred_height (out bar_allocation.height, out n);
bar_allocation.y = child_allocation.y + button_height - bar_allocation.height - 6;
bar_allocation.y = child_allocation.y + (child_allocation.height + bar_allocation.height) / 2;

bar.size_allocate (bar_allocation);

Expand Down

0 comments on commit 81b5f5e

Please sign in to comment.