Fix editable QAbstractView items.
Removes the padding on QLineEdit in QAbstractView items to prevent padding from concealing item text. Closes #69.main
parent
39949cbdff
commit
8d8fc68f63
13799
breeze_resources.py
13799
breeze_resources.py
File diff suppressed because it is too large
Load Diff
|
@ -1838,6 +1838,16 @@ QTreeView::item:!selected:hover
|
||||||
padding: 0.13em;
|
padding: 0.13em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractItemView::item QLineEdit
|
||||||
|
{
|
||||||
|
border: 0em transparent black;
|
||||||
|
/*
|
||||||
|
* The top/bottom padding causes the editable widget to conceal text.
|
||||||
|
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/69
|
||||||
|
*/
|
||||||
|
padding: 0em;
|
||||||
|
}
|
||||||
|
|
||||||
QSlider::handle:horizontal,
|
QSlider::handle:horizontal,
|
||||||
QSlider::handle:vertical
|
QSlider::handle:vertical
|
||||||
{
|
{
|
||||||
|
|
|
@ -1838,6 +1838,16 @@ QTreeView::item:!selected:hover
|
||||||
padding: 0.13em;
|
padding: 0.13em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractItemView::item QLineEdit
|
||||||
|
{
|
||||||
|
border: 0em transparent black;
|
||||||
|
/*
|
||||||
|
* The top/bottom padding causes the editable widget to conceal text.
|
||||||
|
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/69
|
||||||
|
*/
|
||||||
|
padding: 0em;
|
||||||
|
}
|
||||||
|
|
||||||
QSlider::handle:horizontal,
|
QSlider::handle:horizontal,
|
||||||
QSlider::handle:vertical
|
QSlider::handle:vertical
|
||||||
{
|
{
|
||||||
|
|
|
@ -1838,6 +1838,16 @@ QTreeView::item:!selected:hover
|
||||||
padding: 0.13em;
|
padding: 0.13em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractItemView::item QLineEdit
|
||||||
|
{
|
||||||
|
border: 0em transparent black;
|
||||||
|
/*
|
||||||
|
* The top/bottom padding causes the editable widget to conceal text.
|
||||||
|
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/69
|
||||||
|
*/
|
||||||
|
padding: 0em;
|
||||||
|
}
|
||||||
|
|
||||||
QSlider::handle:horizontal,
|
QSlider::handle:horizontal,
|
||||||
QSlider::handle:vertical
|
QSlider::handle:vertical
|
||||||
{
|
{
|
||||||
|
|
|
@ -1838,6 +1838,16 @@ QTreeView::item:!selected:hover
|
||||||
padding: 0.13em;
|
padding: 0.13em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractItemView::item QLineEdit
|
||||||
|
{
|
||||||
|
border: 0em transparent black;
|
||||||
|
/*
|
||||||
|
* The top/bottom padding causes the editable widget to conceal text.
|
||||||
|
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/69
|
||||||
|
*/
|
||||||
|
padding: 0em;
|
||||||
|
}
|
||||||
|
|
||||||
QSlider::handle:horizontal,
|
QSlider::handle:horizontal,
|
||||||
QSlider::handle:vertical
|
QSlider::handle:vertical
|
||||||
{
|
{
|
||||||
|
|
|
@ -208,6 +208,7 @@ def get_compat_definitions(args):
|
||||||
ns.Sunken = ns.FrameShadow.Sunken
|
ns.Sunken = ns.FrameShadow.Sunken
|
||||||
ns.InstantPopup = ns.ToolButtonPopupMode.InstantPopup
|
ns.InstantPopup = ns.ToolButtonPopupMode.InstantPopup
|
||||||
ns.MenuButtonPopup = ns.ToolButtonPopupMode.MenuButtonPopup
|
ns.MenuButtonPopup = ns.ToolButtonPopupMode.MenuButtonPopup
|
||||||
|
ns.ItemIsEditable = ns.ItemFlag.ItemIsEditable
|
||||||
ns.ItemIsUserCheckable = ns.ItemFlag.ItemIsUserCheckable
|
ns.ItemIsUserCheckable = ns.ItemFlag.ItemIsUserCheckable
|
||||||
ns.ItemIsUserTristate = ns.ItemFlag.ItemIsUserTristate
|
ns.ItemIsUserTristate = ns.ItemFlag.ItemIsUserTristate
|
||||||
ns.Checked = ns.CheckState.Checked
|
ns.Checked = ns.CheckState.Checked
|
||||||
|
@ -497,6 +498,7 @@ def get_compat_definitions(args):
|
||||||
ns.AlignHCenter = QtCore.Qt.AlignHCenter
|
ns.AlignHCenter = QtCore.Qt.AlignHCenter
|
||||||
ns.AlignVCenter = QtCore.Qt.AlignVCenter
|
ns.AlignVCenter = QtCore.Qt.AlignVCenter
|
||||||
ns.AlignCenter = QtCore.Qt.AlignCenter
|
ns.AlignCenter = QtCore.Qt.AlignCenter
|
||||||
|
ns.ItemIsEditable = QtCore.Qt.ItemIsEditable
|
||||||
ns.ItemIsUserCheckable = QtCore.Qt.ItemIsUserCheckable
|
ns.ItemIsUserCheckable = QtCore.Qt.ItemIsUserCheckable
|
||||||
ns.ItemIsUserTristate = QtCore.Qt.ItemIsUserTristate
|
ns.ItemIsUserTristate = QtCore.Qt.ItemIsUserTristate
|
||||||
ns.Checked = QtCore.Qt.Checked
|
ns.Checked = QtCore.Qt.Checked
|
||||||
|
|
|
@ -1838,6 +1838,16 @@ QTreeView::item:!selected:hover
|
||||||
padding: 0.13em;
|
padding: 0.13em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractItemView::item QLineEdit
|
||||||
|
{
|
||||||
|
border: 0em transparent black;
|
||||||
|
/*
|
||||||
|
* The top/bottom padding causes the editable widget to conceal text.
|
||||||
|
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/69
|
||||||
|
*/
|
||||||
|
padding: 0em;
|
||||||
|
}
|
||||||
|
|
||||||
QSlider::handle:horizontal,
|
QSlider::handle:horizontal,
|
||||||
QSlider::handle:vertical
|
QSlider::handle:vertical
|
||||||
{
|
{
|
||||||
|
|
45
test/ui.py
45
test/ui.py
|
@ -815,6 +815,16 @@ def test_sortable_list(widget, *_):
|
||||||
|
|
||||||
return child
|
return child
|
||||||
|
|
||||||
|
def test_editable_list(widget, *_):
|
||||||
|
child = QtWidgets.QListWidget(widget)
|
||||||
|
child.setSortingEnabled(True)
|
||||||
|
for index in range(10):
|
||||||
|
item = QtWidgets.QListWidgetItem(f'Item {index + 1}')
|
||||||
|
item.setFlags(item.flags() | compat.ItemIsEditable)
|
||||||
|
child.addItem(item)
|
||||||
|
|
||||||
|
return child
|
||||||
|
|
||||||
def test_key_sequence_edit(widget, *_):
|
def test_key_sequence_edit(widget, *_):
|
||||||
return QtWidgets.QKeySequenceEdit(widget)
|
return QtWidgets.QKeySequenceEdit(widget)
|
||||||
|
|
||||||
|
@ -1161,6 +1171,41 @@ def test_sortable_tree(widget, *_):
|
||||||
|
|
||||||
return tree
|
return tree
|
||||||
|
|
||||||
|
def test_editable_tree(widget, *_):
|
||||||
|
def new_item(widget, columns):
|
||||||
|
item = QtWidgets.QTreeWidgetItem(widget, columns)
|
||||||
|
item.setFlags(item.flags() | compat.ItemIsEditable)
|
||||||
|
return item
|
||||||
|
|
||||||
|
child = []
|
||||||
|
tree1 = QtWidgets.QTreeWidget(widget)
|
||||||
|
tree1.setHeaderLabel('Tree 1')
|
||||||
|
item1 = new_item(tree1, ['Row 1'])
|
||||||
|
item2 = new_item(tree1, ['Row 2'])
|
||||||
|
item3 = new_item(item2, ['Row 2.1'])
|
||||||
|
item3.setFlags(item3.flags() | compat.ItemIsUserCheckable)
|
||||||
|
item3.setCheckState(0, compat.Unchecked)
|
||||||
|
item4 = new_item(item2, ['Row 2.2'])
|
||||||
|
item5 = new_item(item4, ['Row 2.2.1'])
|
||||||
|
item6 = new_item(item5, ['Row 2.2.1.1'])
|
||||||
|
item7 = new_item(item5, ['Row 2.2.1.2'])
|
||||||
|
item7.setFlags(item7.flags() | compat.ItemIsUserCheckable)
|
||||||
|
item7.setCheckState(0, compat.Checked)
|
||||||
|
item8 = new_item(item2, ['Row 2.3'])
|
||||||
|
item8.setFlags(item8.flags() | compat.ItemIsUserTristate)
|
||||||
|
item8.setCheckState(0, compat.PartiallyChecked)
|
||||||
|
item9 = new_item(tree1, ['Row 3'])
|
||||||
|
item10 = new_item(item9, ['Row 3.1'])
|
||||||
|
item11 = new_item(tree1, ['Row 4'])
|
||||||
|
child.append(tree1)
|
||||||
|
tree2 = QtWidgets.QTreeWidget(widget)
|
||||||
|
tree2.setHeaderLabel('Tree 2')
|
||||||
|
tree2.header().setSectionsClickable(True)
|
||||||
|
item12 = new_item(tree2, ['Row 1', 'Column 2', 'Column 3'])
|
||||||
|
child.append(tree2)
|
||||||
|
|
||||||
|
return child
|
||||||
|
|
||||||
def test_hidden_header_tree(widget, *_):
|
def test_hidden_header_tree(widget, *_):
|
||||||
tree = QtWidgets.QTreeWidget(widget)
|
tree = QtWidgets.QTreeWidget(widget)
|
||||||
tree.setHeaderLabel('Tree 1')
|
tree.setHeaderLabel('Tree 1')
|
||||||
|
|
Loading…
Reference in New Issue