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

Commit

Permalink
Re #10: Consistency cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
IBBoard committed Aug 22, 2020
1 parent 4066822 commit 431a38b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/widgets/ComposeImageManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class ComposeImageManager : Gtk.Container {
// GtkContainer API {{{
public override void forall_internal (bool include_internals, Gtk.Callback cb) {
assert (buttons.length == close_buttons.length);
assert (buttons.length == desc_buttons.length);
assert (buttons.length == progress_bars.length);

for (int i = 0; i < this.close_buttons.length;) {
Expand Down Expand Up @@ -165,7 +166,7 @@ class ComposeImageManager : Gtk.Container {
bar.show_all ();
this.progress_bars.add (bar);

// Add the progress bar first so it goes under the image description button
// 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
21 changes: 10 additions & 11 deletions src/window/ComposeTweetWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class ComposeTweetWindow : Gtk.ApplicationWindow {
string[] failed_paths = {};

for (uint i = 0; i < Cb.ComposeJob.MAX_UPLOADS; i++) {
// FIXME: Loading these images stacks the widgets wrong so that you can't get to all of the buttons
string? image_path = account.db.select ("info").cols ("last_tweet_image_%u".printf(i + 1)).once_string ();

if (image_path != null && image_path.length > 0){
Expand Down Expand Up @@ -533,6 +534,7 @@ class ComposeTweetWindow : Gtk.ApplicationWindow {
this.add_image_button.sensitive = false;
this.fav_image_button.sensitive = false;
}
update_send_button_sensitivity ();
}
}

Expand All @@ -546,18 +548,15 @@ class ComposeTweetWindow : Gtk.ApplicationWindow {
[GtkCallback]
public void favorite_image_selected_cb (string path) {
cancel_clicked ();
this.compose_image_manager.show ();
this.compose_image_manager.load_image (path, null);
this.compose_job.upload_image_async (path);
if (this.compose_image_manager.full) {
this.add_image_button.sensitive = false;
this.fav_image_button.sensitive = false;
try {
load_image (path);
}
catch (GLib.Error e) {
// TODO: Proper error checking/reporting
// But it shouldn't happen because we only just picked it from the fav list,
// so the file info should just work
warning ("%s (%s)", e.message, path);
}

if (this.compose_image_manager.n_images > 0)
fav_image_view.set_gifs_enabled (false);

update_send_button_sensitivity ();
}

[GtkCallback]
Expand Down

0 comments on commit 431a38b

Please sign in to comment.