VirtualBox

Changeset 49276 in vbox


Ignore:
Timestamp:
Oct 24, 2013 1:58:35 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90214
Message:

Debugger/VBoxDbgConsole: Backed out r89996.

Location:
trunk/src/VBox/Debugger
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/VBoxDbgConsole.cpp

    r49142 r49276  
    3030#include <QAction>
    3131#include <QContextMenuEvent>
    32 #include <QMenu>
    3332
    3433#include <VBox/dbg.h>
     
    8483    setPalette(Pal);
    8584    setTextColor(QColor(qRgb(0, 0xe0, 0)));
    86     m_fGreenOnBlack = true;
     85
     86#ifdef DEBUG_ramshankar
     87    /* Solaris host (esp. S10) has illegible Courier font (bad aliasing). */
     88    Font.setFamily("Monospace [Monotype]");
     89    setFont(Font);
     90
     91    /* White on black while I'm at it. */
     92    Pal.setColor(QPalette::All, QPalette::Base, QColor(Qt::white));
     93    setPalette(Pal);
     94    setTextColor(QColor(qRgb(0, 0, 0)));
     95#endif
    8796
    8897    NOREF(pszName);
     
    93102{
    94103    Assert(m_hGUIThread == RTThreadNativeSelf());
    95 }
    96 
    97 void
    98 VBoxDbgConsoleOutput::contextMenuEvent(QContextMenuEvent *pEvent)
    99 {
    100     QMenu *pMenu = createStandardContextMenu();
    101 
    102     QAction *pToggleAction = new QAction(tr("Toggle Theme"), this);
    103     pMenu->addSeparator();
    104     pMenu->addAction(pToggleAction);
    105     connect(pToggleAction, SIGNAL(triggered()), this, SLOT(toggleTheme()));
    106 
    107     pMenu->exec(pEvent->globalPos());
    108     delete pMenu;
    109 }
    110 
    111 
    112 void
    113 VBoxDbgConsoleOutput::toggleTheme()
    114 {
    115     QFont Font = font();
    116     Font.setStyleHint(QFont::TypeWriter);
    117     QPalette Pal(palette());
    118 
    119     /* Don't switch fonts on Mac for now. Haven't tested it. */
    120     if (m_fGreenOnBlack)
    121     {
    122         /* Black on White. */
    123 #ifndef Q_WS_MAC
    124         Font.setFamily("Monospace [Monotype]");
    125         setFont(Font);
    126 #endif
    127         Pal.setColor(QPalette::All, QPalette::Base, QColor(Qt::white));
    128         setPalette(Pal);
    129         setTextColor(QColor(qRgb(0, 0, 0)));
    130         m_fGreenOnBlack = false;
    131     }
    132     else
    133     {
    134         /* Green on Black */
    135 #ifndef Q_WS_MAC
    136         Font.setFamily("Courier [Monotype]");
    137         setFont(Font);
    138 #endif
    139         QPalette Pal(palette());
    140         Pal.setColor(QPalette::All, QPalette::Base, QColor(Qt::black));
    141         setPalette(Pal);
    142         setTextColor(QColor(qRgb(0, 0xe0, 0)));
    143         m_fGreenOnBlack = true;
    144     }
    145104}
    146105
  • trunk/src/VBox/Debugger/VBoxDbgConsole.h

    r49142 r49276  
    6262
    6363protected:
    64     /**
    65      * Context menu event.
    66      * This adds custom menu items for the output view.
    67      *
    68      * @param   pEvent      Pointer to the event.
    69      */
    70     virtual void contextMenuEvent(QContextMenuEvent *pEvent);
    71 
    72 
    7364    /** The current line (paragraph) number. */
    7465    unsigned m_uCurLine;
     
    7768    /** The handle to the GUI thread. */
    7869    RTNATIVETHREAD m_hGUIThread;
    79     /** Whether the current theme is 'green-on-black'. */
    80     bool           m_fGreenOnBlack;
    81 
    82 private slots:
    83     /**
    84      * The "Toggle Theme" context-menu item was triggered.
    85      *
    86      * Will toggle font and colors of VBoxDbgConsoleOutput.
    87      */
    88     void         toggleTheme();
    8970};
    9071
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette