let styles override rootCommand in init, plus removing some code I accidentally left in

This commit is contained in:
markt 2007-01-20 18:26:55 +00:00
parent 9de41b30be
commit 832dba7d16
4 changed files with 14 additions and 37 deletions

View file

@ -1,6 +1,9 @@
(Format: Year/Month/Day)
Changes for 1.0rc3:
*07/01/20:
* Let styles override rootCommand in init file -- for the old behavior, add
`background: none' to the overlay file (Mark)
RootTheme.cc/hh Screen.cc
* Don't place windows over toolbar at the top of the screen (Mark)
CascadePlacement.cc
*07/01/16:

View file

@ -85,29 +85,11 @@ public:
(mod_y.length() == 2 && (mod_y[1] < '0' || mod_y[1] > '9')))
mod_y = "1";
// check if any of our values have changed
if (mod_x != m_mod_x) {
m_changed = true;
m_mod_x = mod_x;
}
if (mod_y != m_mod_y) {
m_changed = true;
m_mod_y = mod_y;
}
// these aren't quite right, but I don't care
if (color_name != m_color) {
m_changed = true;
m_color = color_name;
}
if (colorto_name != m_color_to) {
m_changed = true;
m_color_to = colorto_name;
}
// remove whitespace from filename
FbTk::StringUtil::removeFirstWhitespace(pixmap_name);
FbTk::StringUtil::removeTrailingWhitespace(pixmap_name);
// check if the background has been changed
if (mod_x != m_mod_x || mod_y != m_mod_y || pixmap_name != m_filename ||
color_name != m_color || colorto_name != m_color_to) {
m_changed = true;
@ -159,12 +141,10 @@ private:
};
RootTheme::RootTheme(const std::string &root_command,
FbTk::ImageControl &image_control):
RootTheme::RootTheme(FbTk::ImageControl &image_control):
FbTk::Theme(image_control.screenNumber()),
m_background(new BackgroundItem(*this, "background", "Background")),
m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())),
m_root_command(root_command),
m_image_ctrl(image_control) {
Display *disp = FbTk::App::instance()->display();
@ -207,19 +187,10 @@ void RootTheme::reconfigTheme() {
m_background->setApplied();
// if user specified background in the config then use it
// instead of style background
if (!m_root_command.empty()) {
FbCommands::ExecuteCmd cmd(m_root_command, screenNum());
cmd.execute();
return;
}
// style doesn't wish to change the background
if (strstr(m_background->options().c_str(), "none") != 0)
return;
//
// Else parse background from style
//

View file

@ -45,8 +45,7 @@ public:
/// constructor
/// @param resmanager resource manager for finding specific resources
/// @param image_control for rendering background texture
RootTheme(const std::string &root_command,
FbTk::ImageControl &image_control);
RootTheme(FbTk::ImageControl &image_control);
~RootTheme();
bool fallback(FbTk::ThemeItem_base &item);
@ -64,7 +63,6 @@ public:
private:
BackgroundItem *m_background;///< background image/texture
FbTk::GContext m_opgc;
const std::string &m_root_command;
FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture
};

View file

@ -62,7 +62,7 @@
#include "CommandParser.hh"
#include "AtomHandler.hh"
#include "HeadArea.hh"
#include "FbCommands.hh"
#include "FbTk/I18n.hh"
#include "FbTk/Subject.hh"
@ -430,7 +430,13 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
imageControl().installRootColormap();
root_colormap_installed = true;
m_root_theme.reset(new RootTheme(*resource.rootcommand, imageControl()));
// if user specified background in the config then use it
if (!resource.rootcommand->empty()) {
FbCommands::ExecuteCmd cmd(*resource.rootcommand, screenNumber());
cmd.execute();
}
m_root_theme.reset(new RootTheme(imageControl()));
m_windowtheme->setFocusedAlpha(*resource.focused_alpha);
m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha);
@ -505,7 +511,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
// FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get());
//!! TODO: For some strange reason we must load everything,
// else the focus label doesn't get updated
// So we lock root theme temporary so it doesn't uses RootTheme::reconfigTheme
// This must be fixed in the future.
FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(),
fluxbox->getStyleOverlayFilename(),