delete: Improve dialog sizing and scrolling

Drop horizontal scrolling, since with gtk3 hidden scrollbars it might
mean users don't realize there's info that is scrolled off.

Adjust the default sizing to match that pattern
This commit is contained in:
Cole Robinson 2015-05-20 17:42:45 -04:00
parent f8af2e6b10
commit b02cb7ffa0
2 changed files with 9 additions and 3 deletions

View File

@ -7,7 +7,6 @@
<property name="height_request">350</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Delete Virtual Machine</property>
<property name="resizable">False</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
<signal name="delete-event" handler="on_vmm_delete_delete_event" swapped="no"/>
@ -45,9 +44,9 @@
<object class="GtkLabel" id="header-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label">&lt;span size='large' color='white'&gt;Placeholder&lt;/span&gt;</property>
<property name="use_markup">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@ -134,6 +133,7 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkTreeView" id="delete-storage-list">

View File

@ -20,6 +20,7 @@
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
import os
import stat
@ -91,6 +92,7 @@ class vmmDeleteDialog(vmmGObjectUI):
(_("Delete"), util.xml_escape(self.vm.get_name())))
self.widget("header-label").set_markup(title_str)
self.topwin.resize(1, 1)
self.widget("delete-cancel").grab_focus()
# Show warning message if VM is running
@ -295,9 +297,11 @@ def prepare_storage_list(storage_list):
storage_list.set_tooltip_column(STORAGE_ROW_TOOLTIP)
confirmCol = Gtk.TreeViewColumn()
pathCol = Gtk.TreeViewColumn(_("Storage Path"))
targetCol = Gtk.TreeViewColumn(_("Target"))
infoCol = Gtk.TreeViewColumn()
pathCol = Gtk.TreeViewColumn(_("Storage Path"))
pathCol.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
pathCol.set_expand(True)
storage_list.append_column(confirmCol)
storage_list.append_column(pathCol)
@ -316,6 +320,8 @@ def prepare_storage_list(storage_list):
pathCol.pack_start(path_txt, True)
pathCol.add_attribute(path_txt, 'text', STORAGE_ROW_PATH)
pathCol.set_sort_column_id(STORAGE_ROW_PATH)
path_txt.set_property("width-chars", 50)
path_txt.set_property("ellipsize", Pango.EllipsizeMode.MIDDLE)
target_txt = Gtk.CellRendererText()
targetCol.pack_start(target_txt, False)