Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -444,7 +444,7 @@ class EditorWrapper(object):
|
|||||||
builder.add_from_file(os.path.join(dir_name, "glade/config_main.glade"))
|
builder.add_from_file(os.path.join(dir_name, "glade/config_main.glade"))
|
||||||
|
|
||||||
self.window = builder.get_object("main-window")
|
self.window = builder.get_object("main-window")
|
||||||
self.window.set_transient_for(parent)
|
#self.window.set_transient_for(parent)
|
||||||
self.window.set_keep_above(True)
|
self.window.set_keep_above(True)
|
||||||
self.window.set_type_hint(Gdk.WindowTypeHint.DIALOG)
|
self.window.set_type_hint(Gdk.WindowTypeHint.DIALOG)
|
||||||
self.window.connect('destroy', self.show_parent, parent)
|
self.window.connect('destroy', self.show_parent, parent)
|
||||||
@@ -1932,6 +1932,16 @@ class EditorWrapper(object):
|
|||||||
update_icon(self.button_icon, self.panel["icons"])
|
update_icon(self.button_icon, self.panel["icons"])
|
||||||
self.button_icon.connect("changed", update_icon, self.panel["icons"])
|
self.button_icon.connect("changed", update_icon, self.panel["icons"])
|
||||||
|
|
||||||
|
self.button_picker = builder.get_object("btn-picker")
|
||||||
|
img = Gtk.Image.new_from_icon_name("nwg-icon-picker", Gtk.IconSize.BUTTON)
|
||||||
|
self.button_picker.set_image(img)
|
||||||
|
|
||||||
|
if is_command("nwg-icon-picker"):
|
||||||
|
self.button_picker.set_tooltip_text("Pick an icon")
|
||||||
|
self.button_picker.connect("clicked", on_pick_btn, self.button_icon)
|
||||||
|
else:
|
||||||
|
self.button_picker.hide()
|
||||||
|
|
||||||
self.button_label = builder.get_object("label")
|
self.button_label = builder.get_object("label")
|
||||||
self.button_label.set_text(settings["label"])
|
self.button_label.set_text(settings["label"])
|
||||||
|
|
||||||
@@ -2353,6 +2363,12 @@ class EditorWrapper(object):
|
|||||||
self.scrolled_window.add(custom_items_grid)
|
self.scrolled_window.add(custom_items_grid)
|
||||||
|
|
||||||
|
|
||||||
|
def on_pick_btn(btn, entry):
|
||||||
|
s = cmd2string("nwg-icon-picker")
|
||||||
|
if s:
|
||||||
|
entry.set_text(s)
|
||||||
|
|
||||||
|
|
||||||
class ControlsCustomItems(Gtk.Frame):
|
class ControlsCustomItems(Gtk.Frame):
|
||||||
def __init__(self, panel, config, file):
|
def __init__(self, panel, config, file):
|
||||||
check_key(panel, "controls-settings", {})
|
check_key(panel, "controls-settings", {})
|
||||||
@@ -2375,7 +2391,6 @@ class ControlsCustomItems(Gtk.Frame):
|
|||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
|
|
||||||
listbox = Gtk.ListBox()
|
listbox = Gtk.ListBox()
|
||||||
listbox.set_selection_mode(Gtk.SelectionMode.NONE)
|
listbox.set_selection_mode(Gtk.SelectionMode.NONE)
|
||||||
for i in range(len(self.items)):
|
for i in range(len(self.items)):
|
||||||
@@ -2400,6 +2415,12 @@ class ControlsCustomItems(Gtk.Frame):
|
|||||||
entry.connect("changed", self.update_icon, self.icons, i, "icon")
|
entry.connect("changed", self.update_icon, self.icons, i, "icon")
|
||||||
hbox.pack_start(entry, False, False, 0)
|
hbox.pack_start(entry, False, False, 0)
|
||||||
|
|
||||||
|
if is_command("nwg-icon-picker"):
|
||||||
|
btn = Gtk.Button.new_from_icon_name("nwg-icon-picker", Gtk.IconSize.MENU)
|
||||||
|
btn.set_tooltip_text("Pick an icon")
|
||||||
|
btn.connect("clicked", on_pick_btn, entry)
|
||||||
|
hbox.pack_start(btn, False, False, 0)
|
||||||
|
|
||||||
entry = Gtk.Entry()
|
entry = Gtk.Entry()
|
||||||
entry.set_width_chars(15)
|
entry.set_width_chars(15)
|
||||||
entry.set_text(item["cmd"])
|
entry.set_text(item["cmd"])
|
||||||
@@ -2444,6 +2465,12 @@ class ControlsCustomItems(Gtk.Frame):
|
|||||||
self.new_icon.connect("changed", update_icon, self.icons)
|
self.new_icon.connect("changed", update_icon, self.icons)
|
||||||
hbox.pack_start(self.new_icon, False, False, 0)
|
hbox.pack_start(self.new_icon, False, False, 0)
|
||||||
|
|
||||||
|
if is_command("nwg-icon-picker"):
|
||||||
|
btn = Gtk.Button.new_from_icon_name("nwg-icon-picker", Gtk.IconSize.MENU)
|
||||||
|
btn.set_tooltip_text("Pick an icon")
|
||||||
|
btn.connect("clicked", on_pick_btn, self.new_icon)
|
||||||
|
hbox.pack_start(btn, False, False, 0)
|
||||||
|
|
||||||
self.new_command = Gtk.Entry()
|
self.new_command = Gtk.Entry()
|
||||||
self.new_command.set_width_chars(15)
|
self.new_command.set_width_chars(15)
|
||||||
self.new_command.set_placeholder_text("command")
|
self.new_command.set_placeholder_text("command")
|
||||||
|
@@ -179,6 +179,7 @@
|
|||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="tooltip-text" translatable="yes">Attention! Renaming an existing
|
<property name="tooltip-text" translatable="yes">Attention! Renaming an existing
|
||||||
button will create a new one.</property>
|
button will create a new one.</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
<property name="stock">gtk-dialog-warning</property>
|
<property name="stock">gtk-dialog-warning</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@@ -232,6 +233,23 @@ button will create a new one.</property>
|
|||||||
<property name="top-attach">1</property>
|
<property name="top-attach">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="btn-picker">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
<property name="tooltip-text" translatable="yes">Pick an icon</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="always-show-image">True</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">2</property>
|
||||||
|
<property name="top-attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
|
@@ -240,6 +240,37 @@ def instantiate_content(panel, container, content_list, icons_path=""):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("-c",
|
||||||
|
"--config",
|
||||||
|
type=str,
|
||||||
|
default="config",
|
||||||
|
help="config filename (in {}/)".format(common.config_dir))
|
||||||
|
|
||||||
|
parser.add_argument("-s",
|
||||||
|
"--style",
|
||||||
|
type=str,
|
||||||
|
default="style.css",
|
||||||
|
help="css filename (in {}/)".format(common.config_dir))
|
||||||
|
|
||||||
|
parser.add_argument("-sigdwl",
|
||||||
|
type=int,
|
||||||
|
default=10,
|
||||||
|
help="signal to refresh dwl-tags module; default: 10 (SIGUSR1)")
|
||||||
|
|
||||||
|
parser.add_argument("-r",
|
||||||
|
"--restore",
|
||||||
|
action="store_true",
|
||||||
|
help="restore default config files")
|
||||||
|
|
||||||
|
parser.add_argument("-v",
|
||||||
|
"--version",
|
||||||
|
action="version",
|
||||||
|
version="%(prog)s version {}".format(__version__),
|
||||||
|
help="display version information")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Kill running instances, if any
|
# Kill running instances, if any
|
||||||
own_pid = os.getpid()
|
own_pid = os.getpid()
|
||||||
# We should never have more that 1, but just in case
|
# We should never have more that 1, but just in case
|
||||||
@@ -285,37 +316,6 @@ def main():
|
|||||||
else:
|
else:
|
||||||
print("Couldn't determine cache directory", file=sys.stderr)
|
print("Couldn't determine cache directory", file=sys.stderr)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument("-c",
|
|
||||||
"--config",
|
|
||||||
type=str,
|
|
||||||
default="config",
|
|
||||||
help="config filename (in {}/)".format(common.config_dir))
|
|
||||||
|
|
||||||
parser.add_argument("-s",
|
|
||||||
"--style",
|
|
||||||
type=str,
|
|
||||||
default="style.css",
|
|
||||||
help="css filename (in {}/)".format(common.config_dir))
|
|
||||||
|
|
||||||
parser.add_argument("-sigdwl",
|
|
||||||
type=int,
|
|
||||||
default=10,
|
|
||||||
help="signal to refresh dwl-tags module; default: 10 (SIGUSR1)")
|
|
||||||
|
|
||||||
parser.add_argument("-r",
|
|
||||||
"--restore",
|
|
||||||
action="store_true",
|
|
||||||
help="restore default config files")
|
|
||||||
|
|
||||||
parser.add_argument("-v",
|
|
||||||
"--version",
|
|
||||||
action="version",
|
|
||||||
version="%(prog)s version {}".format(__version__),
|
|
||||||
help="display version information")
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
global sig_dwl
|
global sig_dwl
|
||||||
sig_dwl = args.sigdwl
|
sig_dwl = args.sigdwl
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@@ -8,7 +8,7 @@ def read(f_name):
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='nwg-panel',
|
name='nwg-panel',
|
||||||
version='0.6.4',
|
version='0.6.5',
|
||||||
description='GTK3-based panel for sway window manager',
|
description='GTK3-based panel for sway window manager',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
|
Reference in New Issue
Block a user