Logo Search packages:      
Sourcecode: agave version File versions  Download package

void gcs::Widgets::TextSwatch::set_color ( ColorPtr  bg  )  [virtual]

Sets the background color of the colorswatch.

This would perhaps more appropriately be named setColor, since its the main color that is being displayed

Reimplemented from gcs::Widgets::ColorSwatch.

Definition at line 178 of file gcs-textswatch.cc.

References gcs::Widgets::ColorSwatch::m_background, and gcs::Widgets::ColorSwatch::set_color().

        {
            ColorSwatch::set_color(bg);
            std::ostringstream txt;

            // populate the minimal text string
            txt << m_background->get_hexstring() << std::endl;
            Glib::ustring minSpec = txt.str();
            //LOG("Mintext = " << minSpec);
            //LOG("background_ = " << m_background);

            // We can fit more text in the swatch, so add some more info
            txt << "rgb(" << m_background->get_red() << ", " <<
                m_background->get_green() << ", " << m_background->get_blue() << ")" <<
                std::endl;
            txt << "hsv(" << m_background->get_hue() << ", " <<
                m_background->get_saturation() << ", " << m_background->get_value() << ")";
            Glib::ustring maxSpec = txt.str();

            m_pMinText->set_text(minSpec);
            m_pMaxText->set_text(maxSpec);

        }


Generated by  Doxygen 1.6.0   Back to index