Skip to content

Commit

Permalink
Move stock count to after type so it is visible.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielO authored and Bouni committed Jan 24, 2024
1 parent f86269b commit bb1e314
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion library.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,18 @@ def set_order_by(self, n):

def search(self, parameters):
"""Search the database for parts that meet the given parameters."""
# Note: this must mach the widget order in PartSelectorDialog init and
# populate_part_list in parselector.py
columns = [
"LCSC Part",
"MFR.Part",
"Package",
"Solder Joint",
"Library Type",
"Stock",
"Manufacturer",
"Description",
"Price",
"Stock",
]
s = ",".join(f'"{c}"' for c in columns)
query = f"SELECT {s} FROM parts WHERE "
Expand Down
14 changes: 7 additions & 7 deletions partselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@ def __init__(self, parent, parts):
align=wx.ALIGN_LEFT,
flags=wx.dataview.DATAVIEW_COL_RESIZABLE,
).GetRenderer().EnableEllipsize(wx.ELLIPSIZE_NONE)
self.part_list.AppendTextColumn(
"Stock",
mode=wx.dataview.DATAVIEW_CELL_INERT,
width=int(parent.scale_factor * 50),
align=wx.ALIGN_CENTER,
flags=wx.dataview.DATAVIEW_COL_RESIZABLE,
).GetRenderer().EnableEllipsize(wx.ELLIPSIZE_NONE)
self.part_list.AppendTextColumn(
"Manufacturer",
mode=wx.dataview.DATAVIEW_CELL_INERT,
Expand All @@ -442,13 +449,6 @@ def __init__(self, parent, parts):
align=wx.ALIGN_LEFT,
flags=wx.dataview.DATAVIEW_COL_RESIZABLE,
).GetRenderer().EnableEllipsize(wx.ELLIPSIZE_NONE)
self.part_list.AppendTextColumn(
"Stock",
mode=wx.dataview.DATAVIEW_CELL_INERT,
width=int(parent.scale_factor * 50),
align=wx.ALIGN_CENTER,
flags=wx.dataview.DATAVIEW_COL_RESIZABLE,
).GetRenderer().EnableEllipsize(wx.ELLIPSIZE_NONE)

self.part_list.SetMinSize(HighResWxSize(parent.window, wx.Size(1050, 500)))

Expand Down

0 comments on commit bb1e314

Please sign in to comment.