"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Plugins/Qt/QTMStyle.cpp" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

QTMStyle.cpp  (TeXmacs-1.99.4-src):QTMStyle.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 13 skipping to change at line 13
* MODULE : QTMStyle.hpp * MODULE : QTMStyle.hpp
* DESCRIPTION: QT Texmacs custom style (for some elements) * DESCRIPTION: QT Texmacs custom style (for some elements)
* COPYRIGHT : (C) 2008 Massimiliano Gubinelli * COPYRIGHT : (C) 2008 Massimiliano Gubinelli
******************************************************************************* *******************************************************************************
* This software falls under the GNU general public license version 3 or later. * This software falls under the GNU general public license version 3 or later.
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>. * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
******************************************************************************/ ******************************************************************************/
#include "tm_ostream.hpp" #include "tm_ostream.hpp"
#include "renderer.hpp"
#include "QTMStyle.hpp" #include "QTMStyle.hpp"
#include "QTMApplication.hpp" #include "QTMApplication.hpp"
#include <QStyleOptionMenuItem> #include <QStyleOptionMenuItem>
#include <qdrawutil.h> #include <qdrawutil.h>
#include <QPainter> #include <QPainter>
#include <QMainWindow> #include <QMainWindow>
#ifdef UNIFIED_TOOLBAR
bool use_unified_toolbar= true;
#endif
int
qt_zoom (int sz) {
return (int) (retina_scale * ((double) sz));
}
QStyle* QStyle*
qtmstyle () { qtmstyle () {
static QStyle* qtmstyle = NULL; static QStyle* qtmstyle = NULL;
if (!qtmstyle) if (!qtmstyle)
qtmstyle = new QTMStyle (qApp->style()); qtmstyle = new QTMStyle (qApp->style());
return qtmstyle; return qtmstyle;
} }
/****************************************************************************** /******************************************************************************
* QTMProxyStyle (does not own *style) * QTMProxyStyle (does not own *style)
******************************************************************************/ ******************************************************************************/
QTMProxyStyle::QTMProxyStyle (QStyle* _base) : QStyle (), base (_base) { } QTMProxyStyle::QTMProxyStyle (QStyle* _base) : QStyle (), base (_base) { }
inline QStyle *QTMProxyStyle::baseStyle() const { inline QStyle *QTMProxyStyle::baseStyle() const {
return ( base ? base : qApp->style() ); return ( base ? base : qApp->style() );
} }
#if (QT_VERSION >= 0x050000)
int
QTMProxyStyle::layoutSpacing (QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
const QStyleOption *option,
const QWidget *widget) const {
return baseStyle()->layoutSpacing(control1, control2, orientation, option, wid
get);
}
#endif
void void
QTMProxyStyle::drawComplexControl (ComplexControl control, const QStyleOptionCom plex* option, QPainter* painter, const QWidget* widget) const { QTMProxyStyle::drawComplexControl (ComplexControl control, const QStyleOptionCom plex* option, QPainter* painter, const QWidget* widget) const {
baseStyle()->drawComplexControl (control, option, painter, widget); baseStyle()->drawComplexControl (control, option, painter, widget);
} }
void void
QTMProxyStyle::drawControl (ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const { QTMProxyStyle::drawControl (ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const {
baseStyle()->drawControl (element, option, painter, widget); baseStyle()->drawControl (element, option, painter, widget);
} }
skipping to change at line 404 skipping to change at line 425
qstyleoption_cast<const QStyleOptionMenuItem *> (option)) { qstyleoption_cast<const QStyleOptionMenuItem *> (option)) {
QStyleOptionMenuItem mi2(*mi); QStyleOptionMenuItem mi2(*mi);
mi2.text= QString ("pippo"); mi2.text= QString ("pippo");
baseStyle()->drawControl (element, &mi2, painter, widget); baseStyle()->drawControl (element, &mi2, painter, widget);
break; break;
} }
#endif #endif
case CE_ToolBar: { case CE_ToolBar: {
#ifdef UNIFIED_TOOLBAR #ifdef UNIFIED_TOOLBAR
if ((widget) && (widget->windowTitle() == "mode toolbar")) { if (use_unified_toolbar &&
(widget) && (widget->windowTitle() == "mode toolbar")) {
// For unified tool bars, draw nothing. // For unified tool bars, draw nothing.
if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(widget->win dow())) { if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(widget->win dow())) {
if ((mainWindow->unifiedTitleAndToolBarOnMac()) && if ((mainWindow->unifiedTitleAndToolBarOnMac()) &&
(widget->parent()->objectName() != "central widget")) (widget->parent()->objectName() != "central widget"))
break; break;
} }
//QColor mainWindowGradientBeginActive (150, 150, 150); //QColor mainWindowGradientBeginActive (150, 150, 150);
//QColor mainWindowGradientBegin (200, 200, 200); //QColor mainWindowGradientBegin (200, 200, 200);
 End of changes. 4 change blocks. 
1 lines changed or deleted 24 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS