• Luca Bacci's avatar
    Set a default max_width_chars for wrapping Gtk::Labels (!40) · 769d19e0
    Luca Bacci authored
    Opening the Partition Information dialog for a file system mounted on a
    very long mount point, or on openSUSE which mounts the OS from 10 btrfs
    subvolumes from the same partition, will cause the dialog to be very
    wide as the "Mounted on ..." text is not wrapped.
    
    Back in Gtk2, when width_chars / max_width_chars were not set, wrapping
    labels had a default width beyond which text wrapped onto a new line
    [1].
    
    For Gtk3 this default width was first reworked a bit [2], and then was
    removed for the very early Gtk3 3.0.10 release [3].
    
    It is recommended that applications explicitly set default values,
    otherwise wrapping labels never wrap when requesting their natural
    allocation.
    
    References:
    
    [1] Gtk 2.24.32 source code - gtk/gtklabel.c:2975
        https://gitlab.gnome.org/GNOME/gtk/blob/2.24.32/gtk/gtklabel.c#L2975
            "This long string gives a good enough length for any line to
            have."
    
    [2] Gtk commit from 2010-04-21:
        gtk@680d7762
        Make sure not to base the minimum size on "max-width-chars", only
        the natural size.
            "This string is just about long enough."
    
    [3] Gtk commit from 2011-04-17:
        gtk@c8ce1106
        label: Don't try to guess a label's size
    
        People should use window default sizes or label
        width-chars/max-width-chars to find the ideal layout for a label
        instead of relying on magic.
    
    Closes !40 - Limit wrapping labels
    769d19e0
Name
Last commit
Last update
..
BlockSpecial.cc Loading commit data...
CopyBlocks.cc Loading commit data...
DMRaid.cc Loading commit data...
Device.cc Loading commit data...
DialogFeatures.cc Loading commit data...
DialogManageFlags.cc Loading commit data...
DialogPasswordEntry.cc Loading commit data...
Dialog_Base_Partition.cc Loading commit data...
Dialog_Disklabel.cc Loading commit data...
Dialog_FileSystem_Label.cc Loading commit data...
Dialog_Partition_Copy.cc Loading commit data...
Dialog_Partition_Info.cc Loading commit data...
Dialog_Partition_Name.cc Loading commit data...
Dialog_Partition_New.cc Loading commit data...
Dialog_Partition_Resize_Move.cc Loading commit data...
Dialog_Progress.cc Loading commit data...
Dialog_Rescue_Data.cc Loading commit data...
DrawingAreaVisualDisk.cc Loading commit data...
FS_Info.cc Loading commit data...
FileSystem.cc Loading commit data...
Frame_Resizer_Base.cc Loading commit data...
Frame_Resizer_Extended.cc Loading commit data...
GParted_Core.cc Loading commit data...
HBoxOperations.cc Loading commit data...
LUKS_Info.cc Loading commit data...
LVM2_PV_Info.cc Loading commit data...
Makefile.am Loading commit data...
MenuHelpers.cc Loading commit data...
Mount_Info.cc Loading commit data...
Operation.cc Loading commit data...
OperationChangeUUID.cc Loading commit data...
OperationCheck.cc Loading commit data...
OperationCopy.cc Loading commit data...
OperationCreate.cc Loading commit data...
OperationDelete.cc Loading commit data...
OperationDetail.cc Loading commit data...
OperationFormat.cc Loading commit data...
OperationLabelFileSystem.cc Loading commit data...
OperationNamePartition.cc Loading commit data...
OperationResizeMove.cc Loading commit data...
OptionComboBox.cc Loading commit data...
Partition.cc Loading commit data...
PartitionLUKS.cc Loading commit data...
PartitionVector.cc Loading commit data...
PasswordRAMStore.cc Loading commit data...
PipeCapture.cc Loading commit data...
Proc_Partitions_Info.cc Loading commit data...
ProgressBar.cc Loading commit data...
SWRaid_Info.cc Loading commit data...
TreeView_Detail.cc Loading commit data...
Utils.cc Loading commit data...
Win_GParted.cc Loading commit data...
btrfs.cc Loading commit data...
exfat.cc Loading commit data...
ext2.cc Loading commit data...
f2fs.cc Loading commit data...
fat16.cc Loading commit data...
hfs.cc Loading commit data...
hfsplus.cc Loading commit data...
jfs.cc Loading commit data...
linux_swap.cc Loading commit data...
luks.cc Loading commit data...
lvm2_pv.cc Loading commit data...
main.cc Loading commit data...
minix.cc Loading commit data...
nilfs2.cc Loading commit data...
ntfs.cc Loading commit data...
reiser4.cc Loading commit data...
reiserfs.cc Loading commit data...
udf.cc Loading commit data...
xfs.cc Loading commit data...