Subclassed Gtk::ScrolledWindow to make the background white;
seems like a stupid solution, but at least it works. This fixes #1501.
This commit is contained in:
parent
39b1a24e17
commit
5b7f03dce9
6 changed files with 198 additions and 9 deletions
|
@ -147,7 +147,8 @@ WIDGETS_LIB_OBJS = ${TMP_DIR}/ImageButton.o \
|
||||||
${TMP_DIR}/ZebraCellRenderer.o \
|
${TMP_DIR}/ZebraCellRenderer.o \
|
||||||
${TMP_DIR}/Colors.o \
|
${TMP_DIR}/Colors.o \
|
||||||
${TMP_DIR}/MessageWindow.o \
|
${TMP_DIR}/MessageWindow.o \
|
||||||
${TMP_DIR}/DialogWindow.o
|
${TMP_DIR}/DialogWindow.o \
|
||||||
|
${TMP_DIR}/ScrolledWindow.o
|
||||||
|
|
||||||
TEST_EXE_OBJS = ${TMP_DIR}/TestWindow.o \
|
TEST_EXE_OBJS = ${TMP_DIR}/TestWindow.o \
|
||||||
${TMP_DIR}/main.o
|
${TMP_DIR}/main.o
|
||||||
|
|
|
@ -77,7 +77,8 @@ class Colors
|
||||||
LightBlue, BrightBlue, Blue, DarkBlue,
|
LightBlue, BrightBlue, Blue, DarkBlue,
|
||||||
Gray, SlateGray, MediumBlueGray, DarkGray,
|
Gray, SlateGray, MediumBlueGray, DarkGray,
|
||||||
Orange,
|
Orange,
|
||||||
MasterPanelCenterBlue, LiveModeRowBlue } ColorName;
|
MasterPanelCenterBlue, LiveModeRowBlue,
|
||||||
|
WindowBackground = White } ColorName;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2004 Media Development Loan Fund
|
||||||
|
|
||||||
|
This file is part of the LiveSupport project.
|
||||||
|
http://livesupport.campware.org/
|
||||||
|
To report bugs, send an e-mail to bugs@campware.org
|
||||||
|
|
||||||
|
LiveSupport is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
LiveSupport is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with LiveSupport; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
|
Author : $Author$
|
||||||
|
Version : $Revision$
|
||||||
|
Location : $URL$
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------*/
|
||||||
|
#ifndef LiveSupport_Widgets_ScrolledWindow_h
|
||||||
|
#define LiveSupport_Widgets_ScrolledWindow_h
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
|
#error This is a C++ include file
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* ============================================================ include files */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "configure.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <gtkmm/scrolledwindow.h>
|
||||||
|
|
||||||
|
#include "LiveSupport/Widgets/Colors.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace LiveSupport {
|
||||||
|
namespace Widgets {
|
||||||
|
|
||||||
|
using namespace LiveSupport::Core;
|
||||||
|
|
||||||
|
/* ================================================================ constants */
|
||||||
|
|
||||||
|
|
||||||
|
/* =================================================================== macros */
|
||||||
|
|
||||||
|
|
||||||
|
/* =============================================================== data types */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A subclass of Gtk::ScrolledWindow. The only difference is that the
|
||||||
|
* background color is hard-coded to be LiveSupport::Widgets::Colors::White.
|
||||||
|
*
|
||||||
|
* @author $Author$
|
||||||
|
* @version $Revision$
|
||||||
|
*/
|
||||||
|
class ScrolledWindow : public Gtk::ScrolledWindow
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Handle the realize event.
|
||||||
|
*/
|
||||||
|
virtual void
|
||||||
|
on_realize() throw ();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
ScrolledWindow() throw ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A virtual destructor.
|
||||||
|
*/
|
||||||
|
virtual
|
||||||
|
~ScrolledWindow(void) throw ();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* ================================================= external data structures */
|
||||||
|
|
||||||
|
|
||||||
|
/* ====================================================== function prototypes */
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Widgets
|
||||||
|
} // namespace LiveSupport
|
||||||
|
|
||||||
|
#endif // LiveSupport_Widgets_ScrolledWindow_h
|
||||||
|
|
85
livesupport/src/modules/widgets/src/ScrolledWindow.cxx
Normal file
85
livesupport/src/modules/widgets/src/ScrolledWindow.cxx
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2004 Media Development Loan Fund
|
||||||
|
|
||||||
|
This file is part of the LiveSupport project.
|
||||||
|
http://livesupport.campware.org/
|
||||||
|
To report bugs, send an e-mail to bugs@campware.org
|
||||||
|
|
||||||
|
LiveSupport is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
LiveSupport is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with LiveSupport; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
|
Author : $Author$
|
||||||
|
Version : $Revision$
|
||||||
|
Location : $URL$
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* ============================================================ include files */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "configure.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "LiveSupport/Widgets/WidgetFactory.h"
|
||||||
|
#include "LiveSupport/Widgets/ScrolledWindow.h"
|
||||||
|
|
||||||
|
|
||||||
|
using namespace LiveSupport::Core;
|
||||||
|
using namespace LiveSupport::Widgets;
|
||||||
|
|
||||||
|
/* =================================================== local data structures */
|
||||||
|
|
||||||
|
|
||||||
|
/* ================================================ local constants & macros */
|
||||||
|
|
||||||
|
|
||||||
|
/* =============================================== local function prototypes */
|
||||||
|
|
||||||
|
|
||||||
|
/* ============================================================= module code */
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Constructor.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
ScrolledWindow :: ScrolledWindow(void) throw ()
|
||||||
|
: Gtk::ScrolledWindow()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Destructor.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
ScrolledWindow :: ~ScrolledWindow(void) throw ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Handle the realize event.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
ScrolledWindow :: on_realize() throw ()
|
||||||
|
{
|
||||||
|
Gdk::Color bgColor = Colors::getColor(Colors::WindowBackground);
|
||||||
|
Widget * child = get_child();
|
||||||
|
child->modify_bg(Gtk::STATE_NORMAL, bgColor);
|
||||||
|
|
||||||
|
Gtk::ScrolledWindow::on_realize();
|
||||||
|
}
|
||||||
|
|
|
@ -187,12 +187,12 @@ UploadFileWindow :: UploadFileWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
||||||
musicAlignment->add(*musicTable);
|
musicAlignment->add(*musicTable);
|
||||||
talkAlignment->add(*talkTable);
|
talkAlignment->add(*talkTable);
|
||||||
|
|
||||||
Gtk::ScrolledWindow * mainScrolledWindow
|
ScrolledWindow * mainScrolledWindow
|
||||||
= Gtk::manage(new Gtk::ScrolledWindow());
|
= Gtk::manage(new ScrolledWindow());
|
||||||
Gtk::ScrolledWindow * musicScrolledWindow
|
ScrolledWindow * musicScrolledWindow
|
||||||
= Gtk::manage(new Gtk::ScrolledWindow());
|
= Gtk::manage(new ScrolledWindow());
|
||||||
Gtk::ScrolledWindow * talkScrolledWindow
|
ScrolledWindow * talkScrolledWindow
|
||||||
= Gtk::manage(new Gtk::ScrolledWindow());
|
= Gtk::manage(new ScrolledWindow());
|
||||||
|
|
||||||
mainScrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC,
|
mainScrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC,
|
||||||
Gtk::POLICY_AUTOMATIC);
|
Gtk::POLICY_AUTOMATIC);
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
#include <gtkmm/alignment.h>
|
#include <gtkmm/alignment.h>
|
||||||
#include <gtkmm/box.h>
|
#include <gtkmm/box.h>
|
||||||
#include <gtkmm/window.h>
|
#include <gtkmm/window.h>
|
||||||
#include <gtkmm/scrolledwindow.h>
|
|
||||||
|
|
||||||
#include "LiveSupport/Core/Ptr.h"
|
#include "LiveSupport/Core/Ptr.h"
|
||||||
#include "LiveSupport/Core/LocalizedObject.h"
|
#include "LiveSupport/Core/LocalizedObject.h"
|
||||||
|
@ -55,6 +54,7 @@
|
||||||
#include "LiveSupport/Widgets/ComboBoxText.h"
|
#include "LiveSupport/Widgets/ComboBoxText.h"
|
||||||
#include "LiveSupport/Widgets/Notebook.h"
|
#include "LiveSupport/Widgets/Notebook.h"
|
||||||
#include "LiveSupport/Widgets/WhiteWindow.h"
|
#include "LiveSupport/Widgets/WhiteWindow.h"
|
||||||
|
#include "LiveSupport/Widgets/ScrolledWindow.h"
|
||||||
|
|
||||||
#include "GLiveSupport.h"
|
#include "GLiveSupport.h"
|
||||||
#include "MasterPanelUserInfoWidget.h"
|
#include "MasterPanelUserInfoWidget.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue