rearranged themes and added WinButtonTheme
This commit is contained in:
parent
3f62d0e808
commit
456792bbeb
2 changed files with 19 additions and 17 deletions
|
@ -22,7 +22,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: Screen.cc,v 1.141 2003/04/28 12:58:08 rathnor Exp $
|
// $Id: Screen.cc,v 1.142 2003/04/28 22:43:26 fluxgen Exp $
|
||||||
|
|
||||||
|
|
||||||
#include "Screen.hh"
|
#include "Screen.hh"
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
#include "FbWinFrameTheme.hh"
|
#include "FbWinFrameTheme.hh"
|
||||||
#include "MenuTheme.hh"
|
#include "MenuTheme.hh"
|
||||||
#include "RootTheme.hh"
|
#include "RootTheme.hh"
|
||||||
//#include "WinButtonTheme.hh"
|
#include "WinButtonTheme.hh"
|
||||||
#include "FbCommands.hh"
|
#include "FbCommands.hh"
|
||||||
#include "BoolMenuItem.hh"
|
#include "BoolMenuItem.hh"
|
||||||
#include "IntResMenuItem.hh"
|
#include "IntResMenuItem.hh"
|
||||||
|
@ -504,12 +504,15 @@ BScreen::BScreen(ResourceManager &rm,
|
||||||
cycling_focus(false),
|
cycling_focus(false),
|
||||||
cycling_last(0),
|
cycling_last(0),
|
||||||
m_windowtheme(new FbWinFrameTheme(scrn)),
|
m_windowtheme(new FbWinFrameTheme(scrn)),
|
||||||
|
// the order of windowtheme and winbutton theme is important
|
||||||
|
// because winbutton need to rescale the pixmaps in winbutton theme
|
||||||
|
// after fbwinframe have resized them
|
||||||
|
m_winbutton_theme(new WinButtonTheme(scrn)),
|
||||||
m_menutheme(new FbTk::MenuTheme(scrn)),
|
m_menutheme(new FbTk::MenuTheme(scrn)),
|
||||||
resource(rm, screenname, altscreenname),
|
|
||||||
m_root_theme(new
|
m_root_theme(new
|
||||||
RootTheme(scrn,
|
RootTheme(scrn,
|
||||||
*resource.rootcommand)),
|
*resource.rootcommand)),
|
||||||
// m_winbutton_theme(new WinButtonTheme(scrn)),
|
resource(rm, screenname, altscreenname),
|
||||||
m_toolbarhandler(0) {
|
m_toolbarhandler(0) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -827,14 +830,14 @@ void BScreen::reconfigure() {
|
||||||
winFrameTheme().font().setAntialias(*resource.antialias);
|
winFrameTheme().font().setAntialias(*resource.antialias);
|
||||||
m_menutheme->titleFont().setAntialias(*resource.antialias);
|
m_menutheme->titleFont().setAntialias(*resource.antialias);
|
||||||
m_menutheme->frameFont().setAntialias(*resource.antialias);
|
m_menutheme->frameFont().setAntialias(*resource.antialias);
|
||||||
|
|
||||||
// load theme
|
// load theme
|
||||||
std::string theme_filename(Fluxbox::instance()->getStyleFilename());
|
std::string theme_filename(Fluxbox::instance()->getStyleFilename());
|
||||||
FbTk::ThemeManager::instance().load(theme_filename.c_str());
|
FbTk::ThemeManager::instance().load(theme_filename.c_str());
|
||||||
|
|
||||||
I18n *i18n = I18n::instance();
|
I18n *i18n = I18n::instance();
|
||||||
|
|
||||||
const char *s = i18n->getMessage(
|
const char *s = i18n->getMessage(FBNLS::ScreenSet,
|
||||||
FBNLS::ScreenSet,
|
|
||||||
FBNLS::ScreenPositionLength,
|
FBNLS::ScreenPositionLength,
|
||||||
"W: 0000 x H: 0000");
|
"W: 0000 x H: 0000");
|
||||||
int l = strlen(s);
|
int l = strlen(s);
|
||||||
|
@ -907,6 +910,7 @@ void BScreen::reconfigure() {
|
||||||
mem_fun(&FluxboxWindow::reconfigure));
|
mem_fun(&FluxboxWindow::reconfigure));
|
||||||
|
|
||||||
image_control->timeout();
|
image_control->timeout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1332,14 +1336,14 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
|
||||||
//create new buttons
|
//create new buttons
|
||||||
FbTk::Button *newbutton = 0;
|
FbTk::Button *newbutton = 0;
|
||||||
if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) {
|
if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) {
|
||||||
newbutton = new WinButton(win, //*m_winbutton_theme.get(),
|
newbutton = new WinButton(win, *m_winbutton_theme.get(),
|
||||||
WinButton::MINIMIZE,
|
WinButton::MINIMIZE,
|
||||||
frame.titlebar(),
|
frame.titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
newbutton->setOnClick(iconify_cmd);
|
newbutton->setOnClick(iconify_cmd);
|
||||||
|
|
||||||
} else if (win.isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) {
|
} else if (win.isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) {
|
||||||
newbutton = new WinButton(win, //*m_winbutton_theme.get(),
|
newbutton = new WinButton(win, *m_winbutton_theme.get(),
|
||||||
WinButton::MAXIMIZE,
|
WinButton::MAXIMIZE,
|
||||||
frame.titlebar(),
|
frame.titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
|
@ -1349,7 +1353,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
|
||||||
newbutton->setOnClick(maximize_vert_cmd, 2);
|
newbutton->setOnClick(maximize_vert_cmd, 2);
|
||||||
|
|
||||||
} else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) {
|
} else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) {
|
||||||
newbutton = new WinButton(win, //*m_winbutton_theme.get(),
|
newbutton = new WinButton(win, *m_winbutton_theme.get(),
|
||||||
WinButton::CLOSE,
|
WinButton::CLOSE,
|
||||||
frame.titlebar(),
|
frame.titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
|
@ -1359,7 +1363,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
|
||||||
cerr<<__FILE__<<": Creating close button"<<endl;
|
cerr<<__FILE__<<": Creating close button"<<endl;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
} else if ((*dir)[i] == Fluxbox::STICK) {
|
} else if ((*dir)[i] == Fluxbox::STICK) {
|
||||||
WinButton *winbtn = new WinButton(win, // *m_winbutton_theme.get(),
|
WinButton *winbtn = new WinButton(win, *m_winbutton_theme.get(),
|
||||||
WinButton::STICK,
|
WinButton::STICK,
|
||||||
frame.titlebar(),
|
frame.titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
|
@ -1367,7 +1371,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
|
||||||
winbtn->setOnClick(stick_cmd);
|
winbtn->setOnClick(stick_cmd);
|
||||||
newbutton = winbtn;
|
newbutton = winbtn;
|
||||||
} else if ((*dir)[i] == Fluxbox::SHADE) {
|
} else if ((*dir)[i] == Fluxbox::SHADE) {
|
||||||
WinButton *winbtn = new WinButton(win, // *m_winbutton_theme.get(),
|
WinButton *winbtn = new WinButton(win, *m_winbutton_theme.get(),
|
||||||
WinButton::SHADE,
|
WinButton::SHADE,
|
||||||
frame.titlebar(),
|
frame.titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
|
@ -2031,10 +2035,6 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
|
||||||
"no menu label defined\n"));
|
"no menu label defined\n"));
|
||||||
cerr<<"Row: "<<row<<endl;
|
cerr<<"Row: "<<row<<endl;
|
||||||
} else {
|
} else {
|
||||||
/* if (str_cmd.size())
|
|
||||||
menu.insert(str_label.c_str(), BScreen::RESTARTOTHER, str_cmd.c_str());
|
|
||||||
else
|
|
||||||
*/
|
|
||||||
FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd());
|
FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd());
|
||||||
menu.insert(str_label.c_str(), restart_fb);
|
menu.insert(str_label.c_str(), restart_fb);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,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: Screen.hh,v 1.88 2003/04/27 14:36:04 rathnor Exp $
|
// $Id: Screen.hh,v 1.89 2003/04/28 22:42:29 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef SCREEN_HH
|
#ifndef SCREEN_HH
|
||||||
#define SCREEN_HH
|
#define SCREEN_HH
|
||||||
|
@ -48,6 +48,7 @@ class Netizen;
|
||||||
class Toolbar;
|
class Toolbar;
|
||||||
class FbWinFrameTheme;
|
class FbWinFrameTheme;
|
||||||
class RootTheme;
|
class RootTheme;
|
||||||
|
class WinButtonTheme;
|
||||||
class WinClient;
|
class WinClient;
|
||||||
class Workspace;
|
class Workspace;
|
||||||
|
|
||||||
|
@ -373,7 +374,9 @@ private:
|
||||||
Window auto_group_window;
|
Window auto_group_window;
|
||||||
|
|
||||||
std::auto_ptr<FbWinFrameTheme> m_windowtheme;
|
std::auto_ptr<FbWinFrameTheme> m_windowtheme;
|
||||||
|
std::auto_ptr<WinButtonTheme> m_winbutton_theme;
|
||||||
std::auto_ptr<FbTk::MenuTheme> m_menutheme;
|
std::auto_ptr<FbTk::MenuTheme> m_menutheme;
|
||||||
|
std::auto_ptr<RootTheme> m_root_theme;
|
||||||
|
|
||||||
struct ScreenResource {
|
struct ScreenResource {
|
||||||
ScreenResource(ResourceManager &rm, const std::string &scrname,
|
ScreenResource(ResourceManager &rm, const std::string &scrname,
|
||||||
|
@ -411,7 +414,6 @@ private:
|
||||||
|
|
||||||
} resource;
|
} resource;
|
||||||
|
|
||||||
std::auto_ptr<RootTheme> m_root_theme;
|
|
||||||
ToolbarHandler *m_toolbarhandler;
|
ToolbarHandler *m_toolbarhandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue