From 7c43812c04447a81b42f1da9120d825fb86a0f32 Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Tue, 15 Oct 2002 10:57:28 +0000
Subject: antialias option

---
src/Configmenu.cc | 13 ++++++++++---
src/Theme.cc | 13 +++++++------
2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/Configmenu.cc b/src/Configmenu.cc
index 04f7a78..2fed074 100644
--- a/src/Configmenu.cc
+++ b/src/Configmenu.cc
@@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

-// $Id: Configmenu.cc,v 1.17 2002/10/15 09:49:51 fluxgen Exp $
+// $Id: Configmenu.cc,v 1.18 2002/10/15 10:57:28 fluxgen Exp $

#include "Configmenu.hh"

@@ -33,7 +33,7 @@
#include "Tab.hh"

enum {CMENU_USE_TABS=9, CMENU_USE_ICONS, CMENU_SLOPPY_WIN_GROUP,
- CMENU_DESKTOP_WHEELING, CMENU_WORKSPACE_WARPING, CMENU_TAB_ROTATE=21};
+ CMENU_DESKTOP_WHEELING, CMENU_WORKSPACE_WARPING, CMENU_ANTIALIAS, CMENU_TAB_ROTATE=21};

Configmenu::Configmenu(BScreen *scr) : Basemenu(scr),
@@ -92,6 +92,8 @@ m_tabmenu(scr) {
insert(i18n->getMessage(
ConfigmenuSet, ConfigmenuDesktopWheeling,
"Desktop MouseWheel Switching"), CMENU_DESKTOP_WHEELING);
+ //TODO: really need i18n for this?
+ insert("Antialias", CMENU_ANTIALIAS);

update();
setItemSelected(8, screen()->doMaxOverSlit());
@@ -106,6 +108,7 @@ m_tabmenu(scr) {
setItemSelected(CMENU_SLOPPY_WIN_GROUP, screen()->isSloppyWindowGrouping());
setItemSelected(CMENU_WORKSPACE_WARPING, screen()->isWorkspaceWarping());
setItemSelected(CMENU_DESKTOP_WHEELING, screen()->isDesktopWheeling());
+ setItemSelected(CMENU_ANTIALIAS, screen()->antialias());
}

@@ -194,7 +197,11 @@ void Configmenu::itemSelected(int button, unsigned int index) {
screen()->reconfigure();
}
break;
-
+ case CMENU_ANTIALIAS:
+ // Note: no need to reconfigure here, screen reconfigures if antialias changes
+ screen()->setAntialias(!screen()->antialias());
+ setItemSelected(index, screen()->antialias());
+ break;
}
//save resources
Fluxbox::instance()->save_rc();
diff --git a/src/Theme.cc b/src/Theme.cc
index 69f0963..be660d6 100644
--- a/src/Theme.cc
+++ b/src/Theme.cc
@@ -21,7 +21,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

-// $Id: Theme.cc,v 1.29 2002/10/13 22:32:49 fluxgen Exp $
+// $Id: Theme.cc,v 1.30 2002/10/15 10:53:01 fluxgen Exp $

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -916,7 +916,7 @@ void Theme::readDatabaseFont(char *rname, char *rclass, XFontStruct **font) {
}
}

-void Theme::reconfigure() {
+void Theme::reconfigure(bool antialias) {

XGCValues gcv;
unsigned long gc_value_mask = GCForeground;
@@ -966,14 +966,15 @@ void Theme::reconfigure() {
GCForeground, &gcv);

gcv.foreground = m_menustyle.t_text.pixel();
-// if (m_menustyle.titlefont.fontStruct())
-// gcv.font = m_menustyle.titlefont.fontStruct()->fid;
+ if (m_menustyle.titlefont.isAntialias() != antialias)
+ m_menustyle.titlefont.setAntialias(antialias);
+
XChangeGC(m_display, m_menustyle.t_text_gc,
gc_value_mask, &gcv);

gcv.foreground = m_menustyle.f_text.pixel();
-// if (m_menustyle.framefont.fontStruct())
-// gcv.font = m_menustyle.framefont.fontStruct()->fid;
+ if (m_menustyle.framefont.isAntialias() != antialias)
+ m_menustyle.framefont.setAntialias(antialias);

XChangeGC(m_display, m_menustyle.f_text_gc,
gc_value_mask, &gcv);
--
cgit v0.11.2