minor bugfixes

This commit is contained in:
fluxgen 2003-09-10 21:41:18 +00:00
parent 3b66daeaa2
commit 03fd9e1147

View file

@ -20,7 +20,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: IconButton.cc,v 1.7 2003/08/24 16:24:19 fluxgen Exp $ // $Id: IconButton.cc,v 1.8 2003/09/10 21:41:18 fluxgen Exp $
#include "IconButton.hh" #include "IconButton.hh"
@ -98,12 +98,12 @@ void IconButton::exposeEvent(XExposeEvent &event) {
if (m_icon_window == event.window) if (m_icon_window == event.window)
m_icon_window.clear(); m_icon_window.clear();
else else
FbTk::Button::exposeEvent(event); FbTk::TextButton::exposeEvent(event);
} }
void IconButton::moveResize(int x, int y, void IconButton::moveResize(int x, int y,
unsigned int width, unsigned int height) { unsigned int width, unsigned int height) {
FbTk::Button::moveResize(x, y, width, height); FbTk::TextButton::moveResize(x, y, width, height);
if (m_icon_window.width() != FbTk::Button::width() || if (m_icon_window.width() != FbTk::Button::width() ||
m_icon_window.height() != FbTk::Button::height()) m_icon_window.height() != FbTk::Button::height())
@ -111,17 +111,24 @@ void IconButton::moveResize(int x, int y,
} }
void IconButton::resize(unsigned int width, unsigned int height) { void IconButton::resize(unsigned int width, unsigned int height) {
FbTk::Button::resize(width, height); FbTk::TextButton::resize(width, height);
if (m_icon_window.width() != FbTk::Button::width() || if (m_icon_window.width() != FbTk::Button::width() ||
m_icon_window.height() != FbTk::Button::height()) m_icon_window.height() != FbTk::Button::height())
update(0); // update icon window update(0); // update icon window
} }
void IconButton::clear() { void IconButton::clear() {
FbTk::Button::clear(); FbTk::TextButton::clear();
setupWindow(); setupWindow();
} }
void IconButton::clearArea(int x, int y,
unsigned int width, unsigned int height,
bool exposure) {
FbTk::TextButton::clearArea(x, y,
width, height, exposure);
}
void IconButton::update(FbTk::Subject *subj) { void IconButton::update(FbTk::Subject *subj) {
// we got signal that either title or // we got signal that either title or
// icon pixmap was updated, // icon pixmap was updated,
@ -187,6 +194,12 @@ void IconButton::setupWindow() {
setText(m_win.winClient().title()); setText(m_win.winClient().title());
// draw with x offset and y offset // draw with x offset and y offset
drawText(m_icon_window.x() + m_icon_window.width() + 1); drawText();
} }
void IconButton::drawText(int x, int y) {
// offset text
FbTk::TextButton::drawText(m_icon_window.x() + m_icon_window.width() + 1, y);
}