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

No way to set solid background colour #35

Open
sidequestboy opened this issue Jul 25, 2013 · 3 comments
Open

No way to set solid background colour #35

sidequestboy opened this issue Jul 25, 2013 · 3 comments
Milestone

Comments

@sidequestboy
Copy link
Contributor

The code at (SetBG::set_bg on master, SetBG::set_bgon setter_refactor) doesn't allow for a simple interface to set the background to a solid colour with no image file.

UI symptoms:

  • Cannot set solid color to background from GUI
  • Cannot set solid color without specifying a (transparent?) image file from command line using --set-color
@sidequestboy
Copy link
Contributor Author

I think the best thing to do is to modify (SetBG::set_bg on master, SetBG::set_bgon setter_refactor) to decouple the setting of the background colour from the setting of the background image.

This might be useful in the future if you wanted to allow setting solid colours in the GUI, or handle the --set-color without a filename, and here to set a fallback background colour.

That doesn't seem to me to be a matter of simple hacking though. (I'm not familiar with what's going on with pixbufs, colormaps, windows, screens...)

But I do see that your SetBG::make_ functions (here on master, here on setter_refactor) set the background colour with

orig->fill(GdkColorToUint32(bgcolor))

So, if they called a function like this one:

/**
 * Copies and returns pixbuf with bgcolor filled.
 * 
 * @param   orig    The original pixbuf
 * @param   bgcolor The colour to fill background with
 */
Glib::RefPtr<Gdk::Pixbuf> SetBG::fill_colour(const Gdk::Pixbuf orig,
    Gdk::Color bgcolor) {
    Glib::RefPTr<Gdk::Pixbuf> retval = orig->fill(GdkColorToUint32(bgcolor));
    return retval;
}

and we had a function called e.g.

bool SetBG::set_bg_colour(Glib::ustring &disp, Gdk::Color bgcolor);

that did the same stuff as SetBG::set_bg, but with calling this fill_colour function.

or if we hacked the current SetBG::set_bg to handle a "solid color" mode,

that would solve the problem.

@sidequestboy
Copy link
Contributor Author

@RichJack
Copy link

RichJack commented Aug 3, 2015

Has this been implemented yet in any of the builds here on GitHub? I'm using build 1.5.2-2 in Ubuntu 14.04 and I have to use a transparent png to set a solid background color... Thanks

@daf daf added this to the 1.7 milestone Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants