cosmetic changes, added ResizeModel to ScreenRessources

This commit is contained in:
akir 2004-10-18 01:24:24 +00:00
parent 65ce32a28e
commit 2760b03b2e
4 changed files with 33 additions and 8 deletions

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Screen.cc,v 1.295 2004/10/16 22:18:56 akir Exp $
// $Id: Screen.cc,v 1.296 2004/10/18 01:24:23 akir Exp $
#include "Screen.hh"
@ -172,7 +172,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"),
decorate_transient(rm, false, scrname+".decorateTransient", altscrname+".DecorateTransient"),
rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
resizemode(rm, "", scrname+".resizeMode", altscrname+".ResizeMode"),
resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"),
windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"),
focus_model(rm, CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"),
follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"),

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Screen.hh,v 1.148 2004/10/16 22:18:56 akir Exp $
// $Id: Screen.hh,v 1.149 2004/10/18 01:24:23 akir Exp $
#ifndef SCREEN_HH
#define SCREEN_HH
@ -77,6 +77,7 @@ class Subject;
*/
class BScreen : public FbTk::Observer, private FbTk::NotCopyable {
public:
enum ResizeModel { BOTTOMRESIZE = 0, QUADRANTRESIZE, DEFAULTRESIZE = BOTTOMRESIZE };
enum FocusModel { SLOPPYFOCUS = 0, SEMISLOPPYFOCUS, CLICKTOFOCUS };
enum FollowModel { ///< a window becomes active / focussed on a different workspace
IGNORE_OTHER_WORKSPACES = 0, ///< who cares?
@ -128,7 +129,7 @@ public:
FbTk::Menu &configMenu() { return *m_configmenu.get(); }
inline const std::string &getRootCommand() const { return *resource.rootcommand; }
inline const std::string &getResizeMode() const { return *resource.resizemode; }
inline ResizeModel getResizeModel() const { return *resource.resize_model; }
inline FocusModel getFocusModel() const { return *resource.focus_model; }
inline FollowModel getFollowModel() const { return *resource.follow_model; }
@ -437,7 +438,7 @@ private:
focus_last, focus_new,
antialias, auto_raise, click_raises, decorate_transient;
FbTk::Resource<std::string> rootcommand;
FbTk::Resource<std::string> resizemode;
FbTk::Resource<ResizeModel> resize_model;
FbTk::Resource<std::string> windowmenufile;
FbTk::Resource<FocusModel> focus_model;
FbTk::Resource<FollowModel> follow_model;

View file

@ -123,6 +123,30 @@ void FbTk::Resource<FbTk::MenuTheme::MenuMode>::setFromString(const char *str) {
setDefaultValue();
}
template<>
std::string FbTk::Resource<BScreen::ResizeModel>::
getString() {
switch (m_value) {
case BScreen::QUADRANTRESIZE:
return std::string("Quadrant");
case BScreen::BOTTOMRESIZE:
return std::string("Bottom");
};
return std::string("Default");
}
template<>
void FbTk::Resource<BScreen::ResizeModel>::
setFromString(char const *strval) {
if (strcasecmp(strval, "Bottom") == 0) {
m_value = BScreen::BOTTOMRESIZE;
} else if (strcasecmp(strval, "Quadrant") == 0) {
m_value = BScreen::QUADRANTRESIZE;
} else
m_value = BScreen::DEFAULTRESIZE;
}
template<>
std::string FbTk::Resource<BScreen::FocusModel>::
getString() {

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Window.cc,v 1.302 2004/10/17 21:40:15 akir Exp $
// $Id: Window.cc,v 1.303 2004/10/18 01:24:24 akir Exp $
#include "Window.hh"
@ -2585,7 +2585,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
m_resize_corner = RIGHTBOTTOM;
else if (me.window == frame().gripLeft())
m_resize_corner = LEFTBOTTOM;
else if (screen().getResizeMode() != "quadrant")
else if (screen().getResizeModel() != BScreen::QUADRANTRESIZE)
m_resize_corner = RIGHTBOTTOM;
else if (me.x < cx)
m_resize_corner = (me.y < cy) ? LEFTTOP : LEFTBOTTOM;