From bf58e69817b66700c27b02f717ae9e1e3239a503 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 13 Oct 2024 10:10:05 +0300 Subject: [PATCH] add TextView margins --- .../item/page/content/text/gemini/reader/widget.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/reader/widget.rs b/src/app/browser/window/tab/item/page/content/text/gemini/reader/widget.rs index c8c6553a..26bcb1e4 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/reader/widget.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/reader/widget.rs @@ -3,6 +3,8 @@ use gtk::{ }; use std::sync::Arc; +const MARGIN: i32 = 16; + pub struct Widget { gobject: TextView, } @@ -16,11 +18,15 @@ impl Widget { motion_controller: EventControllerMotion, ) -> Arc { let gobject = TextView::builder() - .editable(false) - .cursor_visible(false) - .wrap_mode(WrapMode::Word) - .vexpand(true) + .bottom_margin(MARGIN) .buffer(buffer) + .cursor_visible(false) + .editable(false) + .left_margin(MARGIN) + .right_margin(MARGIN) + .top_margin(MARGIN) + .vexpand(true) + .wrap_mode(WrapMode::Word) .build(); gobject.add_controller(primary_button_controller);