summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-11-17 07:30:08 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-11-17 07:30:08 (GMT)
commitbaef7fad5e4a7f19926c8722e8ab1e1d426d4433 (patch)
treef882ccb39ae6b06ed886519820f06557187f6b14 /src/gtkext
parent187cf13a6f0b0ddbb46fd563d66bb01b0dcd18be (diff)
Fixed raw data display.
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/hexdisplay.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gtkext/hexdisplay.c b/src/gtkext/hexdisplay.c
index 49da03a..f557513 100644
--- a/src/gtkext/hexdisplay.c
+++ b/src/gtkext/hexdisplay.c
@@ -232,19 +232,23 @@ static void gtk_hex_display_size_allocate(GtkWidget *widget, GtkAllocation *allo
GBufferCache *cache; /* Contenu représenté */
gint text_pos; /* Abscisse minimale du texte */
bool show_pos; /* Affichage des positions ? */
+ GWidthTracker *tracker; /* Gestionnaire de largeurs */
+ gint padding; /* Bourrage supplémentaire */
bool changed; /* Note toute variation */
display = GTK_HEX_DISPLAY(widget);
cache = g_buffer_view_get_cache(GTK_BUFFER_DISPLAY(display)->view);
-
text_pos = g_buffer_cache_get_text_position(cache);
-
g_object_unref(G_OBJECT(cache));
show_pos = g_display_options_get(GTK_DISPLAY_PANEL(widget)->options, 0);
- changed = g_hex_generator_auto_fit(display->generator, text_pos, show_pos, allocation->width);
+ tracker = g_buffer_cache_get_width_tracker(display->cache);
+ padding = g_width_tracker_get_column_min_width(tracker, HLC_PADDING);
+ g_object_unref(G_OBJECT(tracker));
+
+ changed = g_hex_generator_auto_fit(display->generator, text_pos, show_pos, padding, allocation->width);
if (changed)
gtk_hex_display_populate_cache(display);