[okteta] [Bug 371800] Automatically adjust the headers in the structures view (w/ patches)

2019-06-11 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=371800

abraa...@gmail.com changed:

   What|Removed |Added

 CC||abraa...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[okteta] [Bug 371800] Automatically adjust the headers in the structures view (w/ patches)

2019-06-11 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=371800

--- Comment #4 from abraa...@gmail.com ---
Comment on attachment 101866
  --> https://bugs.kde.org/attachment.cgi?id=101866
patch: automatically adjust the width of the view headers

>From 4ec66687e337395aaf0f00198652719e4d9a3c80 Mon Sep 17 00:00:00 2001
>From: Staffan Palmroos 
>Date: Fri, 28 Oct 2016 23:37:27 +0300
>Subject: [PATCH] Give the user the option to have the structure view headers
> automatically adjust their widths
>
>---
> .../settings/structviewdisplaysettingswidget.ui| 256 +++--
> kasten/controllers/view/structures/structview.cpp  |  26 ++-
> kasten/controllers/view/structures/structview.h|   1 +
> 3 files changed, 158 insertions(+), 125 deletions(-)
>
>diff --git 
>a/kasten/controllers/view/structures/settings/structviewdisplaysettingswidget.ui
> 
>b/kasten/controllers/view/structures/settings/structviewdisplaysettingswidget.ui
>index c290815..1085251 100644
>--- 
>a/kasten/controllers/view/structures/settings/structviewdisplaysettingswidget.ui
>+++ 
>b/kasten/controllers/view/structures/settings/structviewdisplaysettingswidget.ui
>@@ -6,135 +6,145 @@
>
> 0
> 0
>-411
>-292
>+310
>+421
>
>   
>-  
>-   
>-
>- 
>-  QFormLayout::ExpandingFieldsGrow
>- 
>- 
>-  
>+  
>+   
>+
>+ 7
>+ 7
>+ 297
>+ 407
>+
>+   
>+   
>+
>+ 
>+  
>+   Byte order:
>+  
>+  
>+   kcfg_ByteOrder
>+  
>+ 
>+
>+
>+ 
>+  
>+   QComboBox::AdjustToContents
>+  
>+  
>
>-Byte order:
>+Big endian
>
>-   
>-kcfg_ByteOrder
>-   
>-  
>- 
>- 
>-  
>-   
>-QComboBox::AdjustToContents
>-   
>-   
>-
>- Big endian
>-
>-   
>-   
>-
>- Little endian
>-
>-   
>-  
>- 
>- 
>-  
>-   
>-Use short type names
>-   
>-  
>- 
>- 
>-  
>-   
>-Use locale-aware integer formatting
>-   
>-  
>- 
>- 
>-  
>-   
>-Unsigned values:
>-   
>-   
>-combo_UnsignedDisplayBase
>-   
>-  
>- 
>- 
>-  
>- 
>- 
>-  
>-   
>-Signed values:
>-   
>-   
>-combo_SignedDisplayBase
>-   
>-  
>- 
>- 
>-  
>- 
>- 
>-  
>-   
>-Use locale-aware floating-point formatting
>-   
>-  
>- 
>- 
>-  
>-   
>-Floating-point precision:
>-   
>-   
>-kcfg_FloatPrecision
>-   
>-  
>- 
>- 
>-  
>- 
>- 
>-  
>+  
>+  
>
>-Show numerical value of chars
>-   
>-  
>- 
>- 
>-  
>-   
>-Character value:
>-   
>-   
>-combo_CharDisplayBase
>+Little endian
>
>-  
>- 
>- 
>-  
>- 
>- 
>-  
>- 
>- 
>-  
>- 
>- 
>-  
>- 
>-
>-   
>-  
>+  
>+ 
>+
>+
>+ 
>+  
>+   Use short type names
>+  
>+ 
>+
>+
>+ 
>+  
>+   Use locale-aware integer formatting
>+  
>+ 
>+
>+
>+ 
>+  
>+   Unsigned values:
>+  
>+  
>+   combo_UnsignedDisplayBase
>+  
>+ 
>+
>+
>+ 
>+
>+
>+ 
>+  
>+   Signed values:
>+  
>+  
>+   combo_SignedDisplayBase
>+  
>+ 
>+
>+
>+ 
>+
>+
>+ 
>+  
>+   Use locale-aware floating-point formatting
>+  
>+ 
>+
>+
>+ 
>+  
>+   Floating-point precision:
>+  
>+  
>+   kcfg_FloatPrecision
>+  
>+ 
>+
>+
>+ 
>+
>+
>+ 
>+  
>+   Show numerical value of chars
>+  
>+ 
>+
>+
>+ 
>+  
>+   Character value:
>+  
>+  
>+   combo_CharDisplayBase
>+  
>+ 
>+
>+
>+ 
>+
>+
>+ 
>+
>+
>+ 
>+
>+
>+ 
>+
>+
>+ 
>+  
>+   Adjust header widths automatically
>+  
>+ 
>+
>+   
>+  
>  
>  
>   
>diff --git a/kasten/controllers/view/structures/structview.cpp 
>b/kasten/controllers/view/structures/structview.cpp
>index df121dd..67da76a 100644
>--- a/kasten/controllers/view/structures/structview.cpp
>+++ b/kasten/controllers/view/structures/structview.cpp
>@@ -83,8 +83,14 @@ StructView::StructView(StructTool* tool, QWidget* parent) :
> mStructTreeView->setSortingEnabled(false);
> mStructTreeView->installEventFilter(this);
> QHeaderView* header = mStructTreeView->header();
>-header->setSectionResizeMode(QHeaderView::Interactive);
>-
>+if (Kasten::StructViewPreferences::autoAdjustHeaders())
>+{
>+header->setSectionResizeMode(QHeaderView::ResizeToContents);
>+}
>+else
>+{
>+header

[okteta] [Bug 371800] Automatically adjust the headers in the structures view (w/ patches)

2016-11-02 Thread Staffan Palmroos
https://bugs.kde.org/show_bug.cgi?id=371800

--- Comment #3 from Staffan Palmroos  ---
True, it might be unnecessary to have a setting for it. On the other hand,
there might be a situation where some name or type string is very long or very
indented pushing the value column very far to the right. It could then be
annoying to not be able to make the other columns narrower.

Anyway, I forgot a small piece in the last patch apparently, the entry in the
.kcfg file. I've attached a patch for it should you want to use it.

-- 
You are receiving this mail because:
You are watching all bug changes.

[okteta] [Bug 371800] Automatically adjust the headers in the structures view (w/ patches)

2016-11-02 Thread Staffan Palmroos
https://bugs.kde.org/show_bug.cgi?id=371800

--- Comment #2 from Staffan Palmroos  ---
Created attachment 101985
  --> https://bugs.kde.org/attachment.cgi?id=101985&action=edit
Missing entry in the .kcfg file for the automatic width adjustment

-- 
You are receiving this mail because:
You are watching all bug changes.

[okteta] [Bug 371800] Automatically adjust the headers in the structures view (w/ patches)

2016-10-28 Thread Alex Richardson
https://bugs.kde.org/show_bug.cgi?id=371800

Alex Richardson  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Alex Richardson  ---
I agree this is annoying. Initially I used QHeaderView::ResizeToContents but
once you have a few hundred items it gets extremely slow (even if they aren't
visible). It's quite possible that this issue has been fixed since I initially
wrote the code so maybe I should adjust it to use that by default. I'm not sure
we should add a setting for this, ideally the view should just do the right
thing. I am currently travelling but I'll look into this once I'm back (in two
weeks). Thank you very much for the patch!

-- 
You are receiving this mail because:
You are watching all bug changes.