Changeset 49276 in vbox
- Timestamp:
- Oct 24, 2013 1:58:35 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90214
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/VBoxDbgConsole.cpp
r49142 r49276 30 30 #include <QAction> 31 31 #include <QContextMenuEvent> 32 #include <QMenu>33 32 34 33 #include <VBox/dbg.h> … … 84 83 setPalette(Pal); 85 84 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 87 96 88 97 NOREF(pszName); … … 93 102 { 94 103 Assert(m_hGUIThread == RTThreadNativeSelf()); 95 }96 97 void98 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 void113 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_MAC124 Font.setFamily("Monospace [Monotype]");125 setFont(Font);126 #endif127 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 else133 {134 /* Green on Black */135 #ifndef Q_WS_MAC136 Font.setFamily("Courier [Monotype]");137 setFont(Font);138 #endif139 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 }145 104 } 146 105 -
trunk/src/VBox/Debugger/VBoxDbgConsole.h
r49142 r49276 62 62 63 63 protected: 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 73 64 /** The current line (paragraph) number. */ 74 65 unsigned m_uCurLine; … … 77 68 /** The handle to the GUI thread. */ 78 69 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();89 70 }; 90 71
Note:
See TracChangeset
for help on using the changeset viewer.