fixed timer to update transparent while moving
This commit is contained in:
parent
7df61abcbd
commit
37c8e349fb
2 changed files with 54 additions and 33 deletions
|
@ -19,7 +19,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: FbWinFrame.cc,v 1.43 2003/08/25 16:17:18 fluxgen Exp $
|
// $Id: FbWinFrame.cc,v 1.44 2003/09/10 09:53:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "FbWinFrame.hh"
|
#include "FbWinFrame.hh"
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include "FbTk/TextButton.hh"
|
#include "FbTk/TextButton.hh"
|
||||||
#include "FbTk/App.hh"
|
#include "FbTk/App.hh"
|
||||||
#include "FbTk/Compose.hh"
|
#include "FbTk/Compose.hh"
|
||||||
|
#include "FbTk/SimpleCommand.hh"
|
||||||
|
|
||||||
#include "FbWinFrameTheme.hh"
|
#include "FbWinFrameTheme.hh"
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
|
@ -169,26 +170,12 @@ void FbWinFrame::move(int x, int y) {
|
||||||
if (theme().alpha() == 255)
|
if (theme().alpha() == 255)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
redrawTitlebar();
|
// restart update timer
|
||||||
|
m_update_timer.start();
|
||||||
|
|
||||||
ButtonList::iterator btn_it = m_buttons_left.begin();
|
/*
|
||||||
ButtonList::iterator btn_it_end = m_buttons_left.begin();
|
|
||||||
for (; btn_it != btn_it_end; ++btn_it) {
|
*/
|
||||||
(*btn_it)->clear();
|
|
||||||
(*btn_it)->updateTransparent();
|
|
||||||
}
|
|
||||||
btn_it = m_buttons_right.begin();
|
|
||||||
btn_it_end = m_buttons_right.end();
|
|
||||||
for (; btn_it != btn_it_end; ++btn_it) {
|
|
||||||
(*btn_it)->clear();
|
|
||||||
(*btn_it)->updateTransparent();
|
|
||||||
}
|
|
||||||
m_grip_left.clear();
|
|
||||||
m_grip_right.clear();
|
|
||||||
m_handle.clear();
|
|
||||||
m_grip_left.updateTransparent();
|
|
||||||
m_grip_right.updateTransparent();
|
|
||||||
m_handle.updateTransparent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FbWinFrame::resize(unsigned int width, unsigned int height) {
|
void FbWinFrame::resize(unsigned int width, unsigned int height) {
|
||||||
|
@ -219,6 +206,7 @@ void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) {
|
||||||
|
|
||||||
void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height) {
|
void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height) {
|
||||||
move(x, y);
|
move(x, y);
|
||||||
|
if (width != FbWinFrame::width() || height != FbWinFrame::height())
|
||||||
resize(width, height);
|
resize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -699,7 +687,8 @@ void FbWinFrame::redrawTitle() {
|
||||||
(*btn_it)->clear();
|
(*btn_it)->clear();
|
||||||
(*btn_it)->updateTransparent();
|
(*btn_it)->updateTransparent();
|
||||||
}
|
}
|
||||||
|
m_titlebar.clear();
|
||||||
|
m_label.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FbWinFrame::redrawTitlebar() {
|
void FbWinFrame::redrawTitlebar() {
|
||||||
|
@ -894,6 +883,12 @@ void FbWinFrame::renderButtons() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FbWinFrame::init() {
|
void FbWinFrame::init() {
|
||||||
|
// setup update timer
|
||||||
|
FbTk::RefCount<FbTk::Command> update_transp(new FbTk::SimpleCommand<FbWinFrame>(*this,
|
||||||
|
&FbWinFrame::updateTransparent));
|
||||||
|
m_update_timer.setCommand(update_transp);
|
||||||
|
m_update_timer.setTimeout(10L);
|
||||||
|
m_update_timer.fireOnce(true);
|
||||||
|
|
||||||
m_disable_shape = false;
|
m_disable_shape = false;
|
||||||
|
|
||||||
|
@ -979,13 +974,13 @@ void FbWinFrame::getCurrentFocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
|
||||||
title_color = m_title_focused_color;
|
title_color = m_title_focused_color;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
getUnFocusPixmap(label_pm, title_pm,
|
getUnfocusPixmap(label_pm, title_pm,
|
||||||
label_color, title_color);
|
label_color, title_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FbWinFrame::getUnFocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
|
void FbWinFrame::getUnfocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
|
||||||
FbTk::Color &label_color,
|
FbTk::Color &label_color,
|
||||||
FbTk::Color &title_color) {
|
FbTk::Color &title_color) {
|
||||||
if (m_label_unfocused_pm != 0) {
|
if (m_label_unfocused_pm != 0) {
|
||||||
|
@ -1086,4 +1081,24 @@ void FbWinFrame::renderButtonUnfocus(FbTk::TextButton &button) {
|
||||||
button.clear();
|
button.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FbWinFrame::updateTransparent() {
|
||||||
|
redrawTitlebar();
|
||||||
|
|
||||||
|
ButtonList::iterator button_it = m_buttons_left.begin();
|
||||||
|
ButtonList::iterator button_it_end = m_buttons_left.begin();
|
||||||
|
for (; button_it != button_it_end; ++button_it) {
|
||||||
|
(*button_it)->clear();
|
||||||
|
(*button_it)->updateTransparent();
|
||||||
|
}
|
||||||
|
|
||||||
|
button_it = m_buttons_right.begin();
|
||||||
|
button_it_end = m_buttons_right.end();
|
||||||
|
for (; button_it != button_it_end; ++button_it) {
|
||||||
|
(*button_it)->clear();
|
||||||
|
(*button_it)->updateTransparent();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_grip_left.updateTransparent();
|
||||||
|
m_grip_right.updateTransparent();
|
||||||
|
m_handle.updateTransparent();
|
||||||
|
}
|
||||||
|
|
|
@ -19,17 +19,18 @@
|
||||||
// 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: FbWinFrame.hh,v 1.14 2003/08/24 15:18:09 fluxgen Exp $
|
// $Id: FbWinFrame.hh,v 1.15 2003/09/10 09:53:21 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef FBWINFRAME_HH
|
#ifndef FBWINFRAME_HH
|
||||||
#define FBWINFRAME_HH
|
#define FBWINFRAME_HH
|
||||||
|
|
||||||
#include "FbWindow.hh"
|
#include "FbTk/FbWindow.hh"
|
||||||
#include "EventHandler.hh"
|
#include "FbTk/EventHandler.hh"
|
||||||
#include "RefCount.hh"
|
#include "FbTk/RefCount.hh"
|
||||||
#include "Observer.hh"
|
#include "FbTk/Observer.hh"
|
||||||
#include "Color.hh"
|
#include "FbTk/Color.hh"
|
||||||
#include "FbPixmap.hh"
|
#include "FbTk/FbPixmap.hh"
|
||||||
|
#include "FbTk/Timer.hh"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@ -135,6 +136,9 @@ public:
|
||||||
|
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
void setUseShape(bool value);
|
void setUseShape(bool value);
|
||||||
|
|
||||||
|
void setUpdateDelayTime(long t) { m_update_timer.setTimeout(t); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@name accessors
|
@name accessors
|
||||||
*/
|
*/
|
||||||
|
@ -188,7 +192,7 @@ private:
|
||||||
/// renders to pixmap or sets color
|
/// renders to pixmap or sets color
|
||||||
void render(const FbTk::Texture &tex, FbTk::Color &col, Pixmap &pm,
|
void render(const FbTk::Texture &tex, FbTk::Color &col, Pixmap &pm,
|
||||||
unsigned int width, unsigned int height);
|
unsigned int width, unsigned int height);
|
||||||
void getUnFocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
|
void getUnfocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
|
||||||
FbTk::Color &label_color, FbTk::Color &title_color);
|
FbTk::Color &label_color, FbTk::Color &title_color);
|
||||||
void getCurrentFocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
|
void getCurrentFocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
|
||||||
FbTk::Color &label_color, FbTk::Color &title_color);
|
FbTk::Color &label_color, FbTk::Color &title_color);
|
||||||
|
@ -199,6 +203,7 @@ private:
|
||||||
void init();
|
void init();
|
||||||
/// initiate inserted buttons for current theme
|
/// initiate inserted buttons for current theme
|
||||||
void setupButton(FbTk::Button &btn);
|
void setupButton(FbTk::Button &btn);
|
||||||
|
void updateTransparent();
|
||||||
|
|
||||||
FbWinFrameTheme &m_theme; ///< theme to be used
|
FbWinFrameTheme &m_theme; ///< theme to be used
|
||||||
FbTk::ImageControl &m_imagectrl; ///< Image control for rendering
|
FbTk::ImageControl &m_imagectrl; ///< Image control for rendering
|
||||||
|
@ -282,6 +287,7 @@ private:
|
||||||
ThemeListener m_themelistener;
|
ThemeListener m_themelistener;
|
||||||
std::auto_ptr<Shape> m_shape;
|
std::auto_ptr<Shape> m_shape;
|
||||||
bool m_disable_shape;
|
bool m_disable_shape;
|
||||||
|
FbTk::Timer m_update_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FBWINFRAME_HH
|
#endif // FBWINFRAME_HH
|
||||||
|
|
Loading…
Reference in a new issue