[ghex: 1/2] Add padding after offset



commit 763ee106514c3c00bf0240644f2c8a52a372bfa1
Author: Jan Schejbal <janschejbal users noreply github com>
Date:   Wed Jun 17 01:32:52 2020 +0200

    Add padding after offset
    
    Closes: https://gitlab.gnome.org/GNOME/ghex/-/issues/29

 src/gtkhex.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/gtkhex.c b/src/gtkhex.c
index 6d918da..a9226a1 100644
--- a/src/gtkhex.c
+++ b/src/gtkhex.c
@@ -906,9 +906,9 @@ draw_shadow (GtkWidget *widget,
                                  cr,
                                  border,
                                  border,
-                                 8 * gh->char_width + padding.left + padding.right,
+                                 9 * gh->char_width + padding.left + padding.right,
                                  allocation.height - 2 * border);
-               x += 8 * gh->char_width + padding.left + padding.right + gh->extra_width/2;
+               x += 9 * gh->char_width + padding.left + padding.right + gh->extra_width/2;
        }
 
        gtk_render_frame (context,
@@ -964,7 +964,7 @@ static void recalc_displays(GtkHex *gh, guint width, guint height) {
                       2 * padding.left + 2 * padding.right + req.width;
 
        if(gh->show_offsets)
-               total_width -= padding.left + padding.right + 8 * gh->char_width;
+               total_width -= padding.left + padding.right + 9 * gh->char_width;
 
        total_cpl = total_width / gh->char_width;
 
@@ -1969,7 +1969,7 @@ static void gtk_hex_size_allocate(GtkWidget *w, GtkAllocation *alloc) {
        my_alloc.y = border_width + padding.top;
        my_alloc.height = MAX (alloc->height - 2 * border_width - padding.top - padding.bottom, 1);
        if(gh->show_offsets) {
-               my_alloc.width = 8*gh->char_width;
+               my_alloc.width = 9*gh->char_width;
                gtk_widget_size_allocate(gh->offsets, &my_alloc);
                gtk_widget_queue_draw(gh->offsets);
                my_alloc.x += padding.left + padding.right + my_alloc.width + gh->extra_width/2;
@@ -2028,7 +2028,7 @@ static void gtk_hex_size_request(GtkWidget *w, GtkRequisition *req) {
                sb_req.width + gh->char_width * (gh->priv->default_cpl + (gh->priv->default_cpl - 1) /
                                                                                 gh->group_type);
        if(gh->show_offsets)
-               req->width += padding.left + padding.right + 8 * gh->char_width;
+               req->width += padding.left + padding.right + 9 * gh->char_width;
        req->height = gh->priv->default_lines * gh->char_height + padding.top + padding.bottom +
                2*gtk_container_get_border_width(GTK_CONTAINER(w));
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]