Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing to custom colors error #182

Open
khaume opened this issue Oct 12, 2018 · 5 comments
Open

Changing to custom colors error #182

khaume opened this issue Oct 12, 2018 · 5 comments
Labels

Comments

@khaume
Copy link

khaume commented Oct 12, 2018

Downloaded latest version and used on Ubuntu 18.04. I got an error when trying to change to custom colors:

Traceback (most recent call last): File "/home/khaume/Downloads/numix-folders-master/gui/gui", line 351, in colourbutton_changed self.colour[arg] = gdk_to_hex(colour) File "/home/khaume/Downloads/numix-folders-master/gui/gui", line 33, in gdk_to_hex return "#" + "".join(["%02x" % (colour * 255) for colour in colours]) File "/home/khaume/Downloads/numix-folders-master/gui/gui", line 33, in <listcomp> return "#" + "".join(["%02x" % (colour * 255) for colour in colours]) TypeError: %x format: an integer is required, not float

I changed line 33 in gui/gui to cast the color to int, which solved it:

return "#" + "".join(["%02x" % int(colour * 255) for colour in colours])

@palob palob added the bug label Oct 12, 2018
@abbluiz
Copy link

abbluiz commented Apr 12, 2019

Same here, using Qubes OS with Fedora 29 TemplateVM

@palob
Copy link
Member

palob commented Apr 12, 2019

But you used it with the -t option, right?

@abbluiz
Copy link

abbluiz commented Apr 12, 2019

Not really, I used it with the GUI. But calling the script from the terminal.

@ghost
Copy link

ghost commented May 2, 2020

I'm still running into this bug now, I want to change the colours of the icons to match Adwaita

@gamesbook
Copy link

Same issue - full stack trace:

/home/derek/dev/github/numix-folders/gui/gui:129: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "type" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  self.win = Gtk.ApplicationWindow(Gtk.WindowType.TOPLEVEL, application=app)
/home/derek/dev/github/numix-folders/gui/gui:134: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
  self.win.set_wmclass("numix-folders", "Numix Folders")
/home/derek/dev/github/numix-folders/gui/gui:214: DeprecationWarning: Gtk.ColorButton.set_color is deprecated
  self.colourbuttons[i].set_color(Gdk.color_parse(self.colour[i]))
/home/derek/dev/github/numix-folders/gui/gui:223: DeprecationWarning: Gtk.Widget.modify_font is deprecated
  self.colourentries[i].modify_font(Pango.FontDescription('monospace'))
/home/derek/dev/github/numix-folders/gui/gui:234: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  buttonok = Gtk.Button("_Apply", use_underline=True)
/home/derek/dev/github/numix-folders/gui/gui:236: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  buttonclose = Gtk.Button("_Cancel", use_underline=True)
/home/derek/dev/github/numix-folders/gui/gui:350: DeprecationWarning: Gtk.ColorButton.get_color is deprecated
  colour = widget.get_color()
Traceback (most recent call last):
  File "/home/derek/dev/github/numix-folders/gui/gui", line 351, in colourbutton_changed
    self.colour[arg] = gdk_to_hex(colour)
  File "/home/derek/dev/github/numix-folders/gui/gui", line 33, in gdk_to_hex
    return "#" + "".join(["%02x" % (colour * 255) for colour in colours])
  File "/home/derek/dev/github/numix-folders/gui/gui", line 33, in <listcomp>
    return "#" + "".join(["%02x" % (colour * 255) for colour in colours])
TypeError: %x format: an integer is required, not float
Traceback (most recent call last):
  File "/home/derek/dev/github/numix-folders/gui/gui", line 351, in colourbutton_changed
    self.colour[arg] = gdk_to_hex(colour)
  File "/home/derek/dev/github/numix-folders/gui/gui", line 33, in gdk_to_hex
    return "#" + "".join(["%02x" % (colour * 255) for colour in colours])
  File "/home/derek/dev/github/numix-folders/gui/gui", line 33, in <listcomp>
    return "#" + "".join(["%02x" % (colour * 255) for colour in colours])
TypeError: %x format: an integer is required, not float

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants