Skip to content

Commit

Permalink
Enhance UI layout and text wrapping
Browse files Browse the repository at this point in the history
- Added margins to `search_results_scrolled` in `MainWindow.vala` for better spacing.
- Removed unnecessary horizontal alignment from `bubble` in `MainWindow.vala`.
- Adjusted string concatenation formatting in `MainWindow.vala` for readability.
- Enabled horizontal expansion for `place_name` and `place_location` labels in `LocationResult.vala` to improve text wrapping.
  • Loading branch information
lainsce committed Sep 8, 2024
1 parent 00e2e55 commit 33af702
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/LocationResult.vala
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ public class LocationResult : He.Bin {
var place_name = new Gtk.Label (place.name) {
xalign = 0,
wrap = true,
hexpand = true,
wrap_mode = Pango.WrapMode.WORD_CHAR
};
place_name.add_css_class ("cb-title");

var place_location = new Gtk.Label (place.country ?? "") {
xalign = 0,
wrap = true,
hexpand = true,
wrap_mode = Pango.WrapMode.WORD_CHAR
};
place_location.add_css_class ("cb-subtitle");
Expand Down
6 changes: 3 additions & 3 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class Aqui.MainWindow : He.ApplicationWindow {

var search_results_scrolled = new Gtk.ScrolledWindow () {
child = search_results,
margin_top = margin_bottom = margin_start = margin_end = 8,
height_request = 300,
width_request = 300
};
Expand Down Expand Up @@ -206,7 +207,6 @@ public class Aqui.MainWindow : He.ApplicationWindow {

bubble = new Gtk.Box (Gtk.Orientation.VERTICAL, 6) {
visible = false,
halign = Gtk.Align.START,
vexpand = true,
hexpand_set = true
};
Expand Down Expand Up @@ -479,8 +479,8 @@ public class Aqui.MainWindow : He.ApplicationWindow {
var element = pages.get_object_member(member);
wikipedia_entry.title = element.get_string_member("title");
wikipedia_entry.extract = element.get_string_member("extract").split (". ")[0] +
". " + element.get_string_member("extract").split (". ")[1] +
"."; // We are only interested in a small blurb.
". " + element.get_string_member("extract").split (". ")[1] +
"."; // We are only interested in a small blurb.
wikipedia_entry.pageid = element.get_int_member("pageid");
}

Expand Down

0 comments on commit 33af702

Please sign in to comment.