diff --git a/NEWS b/NEWS
index fb34f860..1abca69b 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,7 @@ Unreleased, MenuLibre 2.3.2
consistent icons
- Unnecessary indentation was removed from the editor sections
- Window dimensions were reduced
+ - Separators are now displayed in the application treeview
- Fixes
- Sidebar borders
- Execute button no longer sensitive for separators
diff --git a/menulibre/MenuEditor.py b/menulibre/MenuEditor.py
index 1f680527..110bb525 100644
--- a/menulibre/MenuEditor.py
+++ b/menulibre/MenuEditor.py
@@ -120,14 +120,15 @@ def menu_to_treestore(treestore, parent, menu_items):
item_type = item[0]
if item_type == MenuItemTypes.SEPARATOR:
executable = ""
- displayed_name = " "
+ displayed_name = _("Separator")
# Translators: Separator menu item
tooltip = _("Separator")
categories = ""
filename = None
- icon = None
- icon_name = ""
- show = True
+ icon_name = "content-loading-symbolic"
+ icon = Gio.ThemedIcon.new(icon_name)
+ item_type = MenuItemTypes.SEPARATOR
+ show = False
else:
executable = item[2]['executable']
displayed_name = escape(item[2]['display_name'])
diff --git a/menulibre/MenulibreApplication.py b/menulibre/MenulibreApplication.py
index 36a1a12a..5c8ce76b 100644
--- a/menulibre/MenulibreApplication.py
+++ b/menulibre/MenulibreApplication.py
@@ -1095,18 +1095,18 @@ def add_directory(self):
def add_separator(self):
"""Add Separator callback function."""
- name = " "
+ name = _("Separator")
# Translators: Separator menu item
tooltip = _("Separator")
categories = ""
filename = None
- icon = None
- icon_name = ""
+ icon_name = "content-loading-symbolic"
+ icon = Gio.ThemedIcon.new(icon_name)
item_type = MenuItemTypes.SEPARATOR
filename = None
executable = ""
row_data = [name, tooltip, executable, categories, item_type, icon,
- icon_name, filename, False, True]
+ icon_name, filename, False, False]
self.treeview.append(row_data)
diff --git a/menulibre/MenulibreTreeview.py b/menulibre/MenulibreTreeview.py
index 2053955e..09b90b46 100644
--- a/menulibre/MenulibreTreeview.py
+++ b/menulibre/MenulibreTreeview.py
@@ -85,7 +85,7 @@ def __init__(self, parent):
# Set the markup property on the Text cell.
col.add_attribute(col_cell_text, "markup", 0)
- # Add the cell data func for the pixbuf column to render icons.
+ # Add the cell data func for the text column to render labels.
col.set_cell_data_func(col_cell_text, self._text_display_func, None)
# Set the Tooltip column.
@@ -474,12 +474,16 @@ def _text_display_func(self, col, renderer, treestore, treeiter,
renderer.set_property("style", Pango.Style.NORMAL)
else:
renderer.set_property("style", Pango.Style.ITALIC)
+ separator = treestore[treeiter][MenuEditor.COL_TYPE] == MenuItemTypes.SEPARATOR
+ renderer.set_property("sensitive", not separator)
renderer.set_property("style-set", True)
def _icon_name_func(self, col, renderer, treestore, treeiter, user_data):
"""CellRenderer function to set the gicon for each row."""
renderer.set_property("gicon",
treestore[treeiter][MenuEditor.COL_G_ICON])
+ separator = treestore[treeiter][MenuEditor.COL_TYPE] == MenuItemTypes.SEPARATOR
+ renderer.set_property("sensitive", not separator)
def _get_selected_iter(self):
"""Return the current treeview model and selected iter."""
diff --git a/po/menulibre.pot b/po/menulibre.pot
index 6c2dad5d..e3477999 100644
--- a/po/menulibre.pot
+++ b/po/menulibre.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-08-06 06:18-0400\n"
+"POT-Creation-Date: 2023-08-07 06:51-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -1293,7 +1293,9 @@ msgid "Select an icon"
msgstr ""
#. Translators: Separator menu item
-#: ../menulibre/MenuEditor.py:125 ../menulibre/MenulibreApplication.py:792
+#: ../menulibre/MenuEditor.py:123 ../menulibre/MenuEditor.py:125
+#: ../menulibre/MenulibreApplication.py:792
+#: ../menulibre/MenulibreApplication.py:1098
#: ../menulibre/MenulibreApplication.py:1100
msgid "Separator"
msgstr ""