//================================================================== KCharSelectTable::KCharSelectTable( QWidget *parent, const char *name, const QString &_font, const QChar &_chr, int _tableNum ) : QGridView( parent, name ), vFont( _font ), vChr( _chr ), vTableNum( _tableNum ), vPos( 0, 0 ), focusItem( _chr ), focusPos( 0, 0 ), d(0) { setBackgroundColor( colorGroup().base() ); setCellWidth( 20 ); setCellHeight( 25 ); setNumCols( 32 ); setNumRows( 8 ); repaintContents( false ); setToolTips(); setFocusPolicy( QWidget::StrongFocus ); setBackgroundMode( QWidget::NoBackground ); }
TrashApplet::TrashApplet(const QString &configFile, Type type, int actions, QWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name), mButton(0) { mButton = new TrashButton(this); if(!parent) setBackgroundMode(X11ParentRelative); mButton->setPanelPosition(position()); setAcceptDrops(true); mpDirLister = new KDirLister(); connect(mpDirLister, SIGNAL(clear()), this, SLOT(slotClear())); connect(mpDirLister, SIGNAL(completed()), this, SLOT(slotCompleted())); connect(mpDirLister, SIGNAL(deleteItem(KFileItem *)), this, SLOT(slotDeleteItem(KFileItem *))); mpDirLister->openURL("trash:/"); }
void NSPluginInstance::doLoadPlugin() { if (!inited) { delete _button; _button = 0L; _loader = NSPluginLoader::instance(); setBackgroundMode(QWidget::NoBackground); WId winid = stub->winId(); if( winid != 0 ) { setProtocol(QXEmbed::XPLAIN); embed( winid ); } else { setProtocol(QXEmbed::XEMBED); } // resize before showing, some plugins are stupid and can't handle repeated // NPSetWindow() calls very well (viewer will avoid the call if not shown yet) resizePlugin(width(), height()); displayPlugin(); show(); inited = true; } }
SpectrumWidget::SpectrumWidget( QWidget *parent, const char* name ) : QWidget( parent, name ) { startValue = 0; endValue = 0; m_LMBPointCurrent.setX( -1 ); m_LMBPointPress.setX( -1 ); m_showtooltip = false; m_realHeight = 200; Gamma = 0.8; IntensityMax = 255; setType( EmissionSpectrum ); setMinimumSize( 400, 230 ); setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); setBackgroundMode( NoBackground ); }
FloatyWnd::FloatyWnd(FloatyPlugin *plugin, unsigned id) : QWidget(NULL, "floaty", WType_TopLevel | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WRepaintNoErase) { m_plugin = plugin; m_id = id; init(); setAcceptDrops(true); setBackgroundMode(NoBackground); #ifdef USE_KDE KWin::setState(winId(), NET::SkipTaskbar | NET::SkipPager); KWin::setOnAllDesktops(winId(), true); #endif m_tip = NULL; tipTimer = new QTimer(this); connect(tipTimer, SIGNAL(timeout()), this, SLOT(showTip())); moveTimer = new QTimer(this); connect(moveTimer, SIGNAL(timeout()), this, SLOT(startMove())); setMouseTracking(true); }
DiagramCanvas::DiagramCanvas( QWidget *parent, const char *name, bool r ) : QWidget( parent, name ), buffer( width(), height() ) { readOnly = r; initialize_colors(); setBackgroundColor( CANVAS ); buffer.resize( 600, 600 ); buffer.fill( CANVAS ); setBackgroundMode( QWidget::NoBackground ); setMouseTracking( TRUE ); edge_creation_in_progress = FALSE; vertex_drag_in_progress = FALSE; proximity_tolerance = 3; num_arcs = 0; num_links = 0; num_cuffs = 0; untouched = TRUE; drill_on = FALSE; }
LinkView::LinkView(QWidget * parent, const char * name, WFlags f): QScrollView(parent, name, f) { setFrameShape( QFrame::StyledPanel ); setFrameShadow( QFrame::Sunken ); setBackgroundMode(Qt::PaletteBase); _blocked = FALSE; splitter = new QSplitter( Qt::Vertical, viewport() ); addChild(splitter); splitter->setMargin(5); splitter->setBackgroundMode(Qt::PaletteBase); splitter->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); splitter->setFrameShape( QFrame::NoFrame ); splitter->setChildrenCollapsible(TRUE); splitter->setHandleWidth( 3 ); splitter->setOpaqueResize(); hardware = new MediaListBox(splitter, "hardware"); splitter->setResizeMode( hardware, QSplitter::KeepSize ); hardware->setFrameShape( QFrame::NoFrame ); hardware->setHScrollBarMode(QScrollView::AlwaysOff); hardware->setVScrollBarMode(QScrollView::AlwaysOff); locations = new DnDListBox(splitter, "locations"); // splitter->setResizeMode( locations, QSplitter::KeepSize ); locations->setFrameShape( QFrame::NoFrame ); locations->setHScrollBarMode(QScrollView::AlwaysOff); locations->setVScrollBarMode(QScrollView::AlwaysOff); // custom area, locations loadLinks(); locations->setCurrentItem(0); locations->setSelected( locations->selectedItem(), false ); hardware->installEventFilter(this); connect (hardware, SIGNAL(highlighted( int )), this, SLOT(unselectLocations())); connect (locations, SIGNAL(highlighted( int )), this, SLOT(unselectHardware())); connect (hardware, SIGNAL(scrolled(int,int)), this, SLOT(scrollBy(int,int))); connect (locations, SIGNAL(scrolled(int,int)), this, SLOT(scrollBy(int,int))); connect (hardware, SIGNAL(itemNumberChanged(bool)), this, SLOT(adjustSplitter2Hardware(bool))); connect (locations, SIGNAL(itemNumberChanged(bool)), this, SLOT(adjustSplitter2Locations())); QTimer::singleShot(50, this, SLOT(adjustSplitter2Locations())); QTimer::singleShot(60, this, SLOT(postInstallEventFilter())); }
QLineEdit::QLineEdit( QWidget *parent, const char *name ) : QWidget( parent, name ) { d = new QLineEditPrivate( this ); connect( &d->blinkTimer, SIGNAL(timeout()), this, SLOT(blinkSlot()) ); connect( &d->dragTimer, SIGNAL(timeout()), this, SLOT(dragScrollSlot()) ); cursorPos = 0; offset = 0; maxLen = 32767; cursorOn = TRUE; markAnchor = 0; markDrag = 0; dragScrolling = FALSE; scrollingLeft = FALSE; tbuf = ""; setFocusPolicy( StrongFocus ); setCursor( ibeamCursor ); setBackgroundMode( PaletteBase ); //setAcceptDrops( TRUE ); }
FloatyWnd::FloatyWnd(FloatyPlugin *plugin, unsigned id) : QWidget(NULL, "floaty", Qt::Window | Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint) { m_plugin = plugin; m_id = id; m_blink = 0; init(); setAcceptDrops(true); setBackgroundMode(Qt::NoBackground); #ifdef USE_KDE KWin::setState(winId(), NET::SkipTaskbar | NET::SkipPager); KWin::setOnAllDesktops(winId(), true); #endif m_tip = NULL; tipTimer = new QTimer(this); connect(tipTimer, SIGNAL(timeout()), this, SLOT(showTip())); moveTimer = new QTimer(this); connect(moveTimer, SIGNAL(timeout()), this, SLOT(startMove())); blinkTimer = new QTimer(this); connect(blinkTimer, SIGNAL(timeout()), this, SLOT(blink())); setMouseTracking(true); }
KColorCells::KColorCells( TQWidget *parent, int rows, int cols ) : TQGridView( parent ) { shade = true; setNumRows( rows ); setNumCols( cols ); colors = new TQColor [ rows * cols ]; for ( int i = 0; i < rows * cols; i++ ) colors[i] = TQColor(); selected = 0; inMouse = false; // Drag'n'Drop setAcceptDrops( true); setHScrollBarMode( AlwaysOff ); setVScrollBarMode( AlwaysOff ); viewport()->setBackgroundMode( PaletteBackground ); setBackgroundMode( PaletteBackground ); }
QwtDial::QwtDial(QWidget* parent, const char* name): QwtSliderBase(Qt::Horizontal, parent, name, Qt::WRepaintNoErase|Qt::WResizeNoErase), d_visibleBackground(FALSE), d_frameShadow(Sunken), d_lineWidth(0), d_mode(RotateNeedle), d_origin(90.0), d_minScaleArc(0.0), d_maxScaleArc(0.0), d_scaleDraw(0), d_maxMajIntv(36), d_maxMinIntv(10), d_scaleStep(0.0), d_needle(0) { setBackgroundMode(NoBackground); setFocusPolicy(QWidget::TabFocus); QPalette p = palette(); for ( int i = 0; i < QPalette::NColorGroups; i++ ) { const QPalette::ColorGroup cg = (QPalette::ColorGroup)i; // Base: background color of the circle inside the frame. // Foreground: background color of the circle inside the scale p.setColor(cg, QColorGroup::Foreground, p.color(cg, QColorGroup::Base)); } setPalette(p); d_scaleDraw = new QwtDialScaleDraw(this); d_scaleDraw->setGeometry(0, 0, 0, QwtScaleDraw::Round); setScaleArc(0.0, 360.0); // scale as a full circle setRange(0.0, 360.0, 1.0, 10); // degrees as deafult }
DatePlot::DatePlot (QWidget *w) : QWidget(w) { setBackgroundMode(Qt::NoBackground); scaleWidth = SCALE_WIDTH; startX = 2; backgroundColor.setNamedColor("black"); borderColor.setNamedColor("white"); pixelspace = 0; interval = BarData::DailyBar; startIndex = 0; data = 0; // setMouseTracking(TRUE); setFocusPolicy(Qt::ClickFocus); plotFont.setFamily("DejaVu Sans"); plotFont.setPointSize(10); plotFont.setWeight(50); setMinimumHeight(DATE_HEIGHT); setMaximumHeight(DATE_HEIGHT); dateList.setAutoDelete(TRUE); }
KSystemTray::KSystemTray(QWidget *parent, const char *name) : QLabel(parent, name, WType_TopLevel) { #ifdef Q_WS_X11 QXEmbed::initialize(); #endif d = new KSystemTrayPrivate; d->actionCollection = new KActionCollection(this); #ifdef Q_WS_X11 KWin::setSystemTrayWindowFor(winId(), parent ? parent->topLevelWidget()->winId() : qt_xrootwin()); #endif setBackgroundMode(X11ParentRelative); setBackgroundOrigin(WindowOrigin); hasQuit = 0; menu = new KPopupMenu(this); menu->insertTitle(kapp->miniIcon(), kapp->caption()); move(-1000, -1000); KStdAction::quit(this, SLOT(maybeQuit()), d->actionCollection); if(parentWidget()) { new KAction(i18n("Minimize"), KShortcut(), this, SLOT(minimizeRestoreAction()), d->actionCollection, "minimizeRestore"); #ifdef Q_WS_X11 KWin::WindowInfo info = KWin::windowInfo(parentWidget()->winId()); d->on_all_desktops = info.onAllDesktops(); #else d->on_all_desktops = false; #endif } else { d->on_all_desktops = false; } setCaption(KGlobal::instance()->aboutData()->programName()); setAlignment(alignment() | Qt::AlignVCenter | Qt::AlignHCenter); }
FLConnectDBDialog::FLConnectDBDialog( bool disabled, QWidget * parent, const char *name, WFlags fl, const QString & strConn ) : FLWidgetConnectDB( parent, name, false, fl ), error_( true ) { setDisabled( disabled ); setBackgroundMode( Qt::NoBackground ); logo = QImage::fromMimeSource( "logo_abanq.png" ); QString verMsg( "<p align=\"center\"><b>AbanQ %1</b><br>" "http://www.infosial.com<br>" "http://www.abanq.com</p>" ); lblCredito->setText( verMsg.arg( VERSION ) ); QSettings settings; settings.setPath( "InfoSiAL", "FacturaLUX", QSettings::User ); QString keybase( "/facturalux/lite/" ); comboBoxMarks->insertStringList( settings.readListEntry( keybase + "DBA/marks" ) ); lineEditUser->setText( settings.readEntry( keybase + "DBA/username" ) ); lineEditPassword->setText( settings.readEntry( keybase + "DBA/password" ) ); lineEditHost->setText( settings.readEntry( keybase + "DBA/hostname", "localhost" ) ); comboBoxNameDB->clear(); comboBoxNameDB->insertStringList( settings.readListEntry( keybase + "DBA/namesDB" ) ); comboBoxNameDB->setCurrentText( settings.readEntry( keybase + "DBA/lastDB", "abanq" ) ); lineEditUser->setFocus(); connect( comboBoxNameDB, SIGNAL( activated( const QString & ) ), this, SLOT( changeDB( const QString & ) ) ); comboBoxDB->insertStringList( FLSqlDatabase::driverAliases() ); QString alias = settings.readEntry( keybase + "DBA/db", FLSqlDatabase::defaultAlias() ); comboBoxDB->setCurrentText( alias ); driverChanged( comboBoxDB->currentText() ); lineEditPort->setText( settings.readEntry( keybase + "DBA/port", FLSqlDatabase::defaultPort( alias ) ) ); if ( !strConn.isEmpty() ) selectMark( strConn ); }
DocumentWidget::DocumentWidget(QWidget *parent, PageView *sv, DocumentPageCache *cache, const char *name ) : QWidget( parent, name ), indexOfUnderlinedLink(-1) { moveTool = true; selectionNeedsUpdating = false; // Variables used in animation. animationCounter = 0; timerIdent = 0; documentCache = cache; scrollView = sv; pixmapRequested = false; scrollGuide = -1; setMouseTracking(true); setFocusPolicy(QWidget::ClickFocus); connect(&clearStatusBarTimer, SIGNAL(timeout()), this, SLOT(clearStatusBar())); setBackgroundMode(Qt::NoBackground); if (!busyIcon) { busyIcon = new QPixmap(KGlobal::iconLoader()->loadIcon("gear", KIcon::NoGroup, KIcon::SizeMedium)); URShadow = new QPixmap(); BRShadow = new QPixmap(); BLShadow = new QPixmap(); URShadow->resize(4,4); BRShadow->resize(4,4); BLShadow->resize(4,4); } }
KomposeFullscreenWidget::KomposeFullscreenWidget( int displayType, KomposeLayout *l ) : AbstractViewWidget( 0, l ) { // if ( QT_VERSION < 0x030300 ) /* use showMaximized instead of setWindowState to make it compile on qt 3.1 or whatever */ // showMaximized(); // KWin::setState( winId(), NET::KeepAbove ); // Set Desktop background as our background setBackgroundMode( Qt::FixedPixmap ); // setBackgroundPixmap(*(KomposeGlobal::self()->getDesktopBgPixmap())); rootpix = new KRootPixmap (this); rootpix->start(); m_menu = KomposeGlobal::self()->getViewMenu(); initView(); // Alternate showFullscreen setWindowState(windowState() | WindowFullScreen); if (KomposeSettings::self()->viewScreen() == -1) setGeometry( KGlobalSettings::desktopGeometry( this ) ); else { QDesktopWidget deskwidget; QRect deskRect = deskwidget.screenGeometry(KomposeSettings::self()->viewScreen()); setGeometry(deskRect); kdDebug() << deskRect << endl; } if (!isTopLevel()) QApplication::sendPostedEvents(this, QEvent::ShowFullScreen); setActiveWindow(); KWin::setOnAllDesktops( winId(), true ); }
void Tips::paintEvent(QPaintEvent* ) { #ifndef NO_EZX setBackgroundMode( QWidget::NoBackground ); #else setBackgroundMode( Qt::NoBackground ); #endif //NO_EZX setPalette( QToolTip::palette(), TRUE ); const int shadowWidth = 6; // also used as '5' and '6' and even '8' below const int vMargin = 8; const int hMargin = 12; if ( currentText.isEmpty() ) return; QRect r; #ifndef QT_NO_RICHTEXT QSimpleRichText* doc = 0; if ( QStyleSheet::mightBeRichText( currentText ) ) { doc = new QSimpleRichText( currentText, font() ); doc->adjustSize(); r.setRect( 0, 0, doc->width(), doc->height() ); } else #endif { int sw = QApplication::desktop()->width() / 3; if ( sw < 200 ) sw = 200; else if ( sw > 300 ) sw = 300; r = fontMetrics().boundingRect( 0, 0, sw, 1000, Qt::AlignLeft + Qt::AlignTop + Qt::WordBreak + Qt::ExpandTabs, currentText ); } int w = r.width() + 2*hMargin; int h = r.height() + 2*vMargin; // okay, now to find a suitable location int x; // first try locating the widget immediately above/below, // with nice alignment if possible. QPoint pos; if ( parentWidget() ) pos = parentWidget()->mapToGlobal( QPoint( 0,0 ) ); if ( parentWidget() && w > parentWidget()->width() + 16 ) x = pos.x() + parentWidget()->width()/2 - w/2; else x = ppos.x() - w/2; // squeeze it in if that would result in part of what's this // being only partially visible if ( x + w > QApplication::desktop()->width() ) x = (parentWidget()? (QMIN(QApplication::desktop()->width(), pos.x() + parentWidget()->width()) ) : QApplication::desktop()->width() ) - w; int sx = QApplication::desktop()->x(); int sy = QApplication::desktop()->y(); if ( x < sx ) x = sx; int y; if ( parentWidget() && h > parentWidget()->height() + 16 ) { y = pos.y() + parentWidget()->height() + 2; // below, two pixels spacing // what's this is above or below, wherever there's most space if ( y + h + 10 > QApplication::desktop()->height() ) y = pos.y() + 2 - shadowWidth - h; // above, overlap } y = ppos.y() + 2; // squeeze it in if that would result in part of what's this // being only partially visible if ( y + h > QApplication::desktop()->height() ) y = ( parentWidget() ? (QMIN(QApplication::desktop()->height(), pos.y() + parentWidget()->height()) ) : QApplication:: desktop()->height() ) - h; if ( y < sy ) y = sy; setGeometry( x, y, w + shadowWidth, h + shadowWidth ); show(); // now for super-clever shadow stuff. super-clever mostly in // how many window system problems it skirts around. QPainter p( this ); p.setPen( colorGroup().foreground() ); p.drawRect( 0, 0, w, h ); p.setPen( colorGroup().mid() ); p.setBrush( colorGroup().background() ); p.drawRect( 1, 1, w-2, h-2 ); p.setPen( colorGroup().foreground() ); #ifndef QT_NO_RICHTEXT if ( doc ) { doc->draw( &p, hMargin, vMargin, r, colorGroup(), 0 ); delete doc; } else #endif { p.drawText( hMargin, vMargin, r.width(), r.height(), Qt::AlignLeft + Qt::AlignTop + Qt::WordBreak + Qt::ExpandTabs, currentText ); } p.setPen( colorGroup().shadow() ); p.drawPoint( w + 5, 6 ); p.drawLine( w + 3, 6, w + 5, 8 ); p.drawLine( w + 1, 6, w + 5, 10 ); int i; for( i=7; i < h; i += 2 ) p.drawLine( w, i, w + 5, i + 5 ); for( i = w - i + h; i > 6; i -= 2 ) p.drawLine( i, h, i + 5, h + 5 ); for( ; i > 0 ; i -= 2 ) p.drawLine( 6, h + 6 - i, i + 5, h + 5 ); }
DockWnd::DockWnd(QWidget *main) : QWidget(NULL, "dock", WType_TopLevel | WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop) { setMouseTracking(true); connect(this, SIGNAL(toggleWin()), main, SLOT(toggleShow())); connect(this, SIGNAL(showPopup(QPoint)), main, SLOT(showDockPopup(QPoint))); connect(this, SIGNAL(doubleClicked()), main, SLOT(dockDblClicked())); connect(pClient, SIGNAL(event(ICQEvent*)), this, SLOT(processEvent(ICQEvent*))); connect(pMain, SIGNAL(iconChanged()), this, SLOT(reset())); connect(pMain, SIGNAL(msgChanged()), this, SLOT(reset())); m_state = 0; showIcon = State; QTimer *t = new QTimer(this); connect(t, SIGNAL(timeout()), this, SLOT(timer())); t->start(800); bNoToggle = false; #ifdef WIN32 QWidget::hide(); QWidget::setIcon(Pict(pClient->getStatusIcon())); gDock = this; oldDockProc = (WNDPROC)SetWindowLongW(winId(), GWL_WNDPROC, (LONG)DockWindowProc); if (oldDockProc == 0) oldDockProc = (WNDPROC)SetWindowLongA(winId(), GWL_WNDPROC, (LONG)DockWindowProc); NOTIFYICONDATAA notifyIconData; notifyIconData.cbSize = sizeof(notifyIconData); notifyIconData.hIcon = topData()->winIcon; notifyIconData.hWnd = winId(); notifyIconData.szTip[0] = 0; notifyIconData.uCallbackMessage = WM_DOCK; notifyIconData.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; notifyIconData.uID = 0; Shell_NotifyIconA(NIM_ADD, ¬ifyIconData); #else setMinimumSize(22, 22); resize(22, 22); bInit = false; inTray = false; inNetTray = false; Display *dsp = x11Display(); WId win = winId(); if (bEnlightenment){ wharfIcon = NULL; bInit = true; resize(48, 48); setFocusPolicy(NoFocus); move(pMain->getDockX(), pMain->getDockY()); reset(); MWMHints mwm; mwm.flags = MWM_HINTS_DECORATIONS; mwm.functions = 0; mwm.decorations = 0; mwm.inputMode = 0; mwm.status = 0; Atom a = XInternAtom(dsp, "_MOTIF_WM_HINTS", False); XChangeProperty(dsp, win, a, a, 32, PropModeReplace, (unsigned char *)&mwm, sizeof(MWMHints) / 4); XStoreName(dsp, win, "SIM"); XClassHint *xch = XAllocClassHint(); xch->res_name = (char*)"SIM"; xch->res_class = (char*)"Epplet"; XSetClassHint(dsp, win, xch); XFree(xch); XSetIconName(dsp, win, "SIM"); unsigned long val = (1 << 0) /* | (1 << 9) */ ; a = XInternAtom(dsp, "_WIN_STATE", False); XChangeProperty(dsp, win, a, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); val = 2; a = XInternAtom(dsp, "_WIN_LAYER", False); XChangeProperty(dsp, win, a, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); val = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 5); a = XInternAtom(dsp, "_WIN_HINTS", False); XChangeProperty(dsp, win, a, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); win_name = "SIM"; win_version = VERSION; win_info = ""; while (!comms_win) { ECommsSetup(dsp); sleep(1); } char s[256]; snprintf(s, sizeof(s), "set clientname %s", win_name); ECommsSend(s); snprintf(s, sizeof(s), "set version %s", win_version); ECommsSend(s); snprintf(s, sizeof(s), "set info %s", win_info); ECommsSend(s); ESYNC; set_background_properties(this); show(); return; } wharfIcon = new WharfIcon(this); setBackgroundMode(X11ParentRelative); const QPixmap &pict = Pict(pClient->getStatusIcon()); setIcon(pict); XClassHint classhint; classhint.res_name = (char*)"sim"; classhint.res_class = (char*)"Wharf"; XSetClassHint(dsp, win, &classhint); Screen *screen = XDefaultScreenOfDisplay(dsp); int screen_id = XScreenNumberOfScreen(screen); char buf[32]; snprintf(buf, sizeof(buf), "_NET_SYSTEM_TRAY_S%d", screen_id); Atom selection_atom = XInternAtom(dsp, buf, false); XGrabServer(dsp); Window manager_window = XGetSelectionOwner(dsp, selection_atom); if (manager_window != None) XSelectInput(dsp, manager_window, StructureNotifyMask); XUngrabServer(dsp); XFlush(dsp); if (manager_window != None){ inNetTray = true; if (!send_message(dsp, manager_window, SYSTEM_TRAY_REQUEST_DOCK, win, 0, 0)){ inNetTray = false; } } Atom kde_net_system_tray_window_for_atom = XInternAtom(dsp, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", false); long data[1]; data[0] = 0; XChangeProperty(dsp, win, kde_net_system_tray_window_for_atom, XA_WINDOW, 32, PropModeReplace, (unsigned char*)data, 1); XWMHints *hints; hints = XGetWMHints(dsp, win); hints->initial_state = WithdrawnState; hints->icon_x = 0; hints->icon_y = 0; hints->icon_window = wharfIcon->winId(); hints->window_group = win; hints->flags = WindowGroupHint | IconWindowHint | IconPositionHint | StateHint; XSetWMHints(dsp, win, hints); XFree( hints ); XSetCommand(dsp, win, _argv, _argc); if (!inNetTray){ move(-21, -21); resize(22, 22); } show(); #endif reset(); }
void MainWindow::changeSetting() { m_toggleDockingAction->setChecked(ScimKdeSettings::dockingToPanelApplet()); toggleDocking(true); //retrieve the m_mode first if(m_mode == StandAlone) { //re-initialize embed if next time toggle to that docking mode m_embedInitialized = false; setName("mainWindow"); reparent(0, Qt::WStyle_Customize | Qt::WX11BypassWM | Qt::WStyle_StaysOnTop, ScimKdeSettings::mainWindow_Position(),false); m_moveHandle->show(); setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); //if margin is 0, the frame can not be drawn correctly, frameWidth() is // sometimes too big (>1 and the main m_toolbar is not so decent), so // just fix it to 1 m_mainWindowLayout->setMargin(1); setBackgroundOrigin(QWidget::WindowOrigin); } else { //change name so that it won't be listed in the composite management page setName("mainWindow_embedded"); setWFlags(Qt::WStyle_Customize); m_moveHandle->hide(); setFrameStyle( QFrame::NoFrame ); m_mainWindowLayout->setMargin(0); setBackgroundOrigin(QWidget::AncestorOrigin); setBackgroundMode(QWidget::X11ParentRelative); } m_autoHideTimeout = ScimKdeSettings::hide_Timeout() * 1000; m_alwaysShow = ScimKdeSettings::always_Show(); m_autoSnap = ScimKdeSettings::auto_Snap(); requestReloadSelf(); if( m_alwaysShow && m_autoHideTimeout > 0 && m_mode == StandAlone) { if(!m_autoHideTimeoutTimer) { m_autoHideTimeoutTimer = new QTimer(this); connect( m_autoHideTimeoutTimer, SIGNAL( timeout() ), this, SLOT( hideToolbar() ) ); } } else { if(m_autoHideTimeoutTimer) m_autoHideTimeoutTimer->deleteLater(); m_autoHideTimeoutTimer = 0; m_toolbar->show(); if(m_mode == StandAlone) m_moveHandle->show(); } m_alwaysShowHandle = ScimKdeSettings::alwaysShowHandle(); m_alwaysShowExtensionHandle = ScimKdeSettings::alwaysShowExtensionHandle(); if(m_mode == PanelEmbedded) { //init m_alwaysShowHandle option support timer if(m_alwaysShowHandle) { if(m_showHandleTimer) m_showHandleTimer->deleteLater(); m_showHandleTimer = 0; } else { if(!m_showHandleTimer) { m_showHandleTimer = new QTimer(this); connect(m_showHandleTimer, SIGNAL(timeout()), this, SLOT(showHandleRequest())); } } //init m_alwaysShowExtensionHandle option support timer if(m_alwaysShowExtensionHandle) { if(m_showExtHandleTimer) m_showExtHandleTimer->deleteLater(); m_showExtHandleTimer = 0; if(m_embeddedAreaSize.isValid()) //only reset m_toolbar size if m_embeddedAreaSize is set before resetToolbarSize(m_embeddedAreaSize); } else { if(!m_showExtHandleTimer) { m_showExtHandleTimer = new QTimer(this); connect(m_showExtHandleTimer, SIGNAL(timeout()), this, SLOT(showExtHandleRequest())); } } initEmbedPanel(); } if(m_mode == StandAlone) { if(m_alwaysShow) { if(m_autoHideTimeoutTimer && !m_logo) { m_logo = new QLabel(this); m_logo->setPixmap(KGlobal::iconLoader()->loadIcon("skim", KIcon::Toolbar)); m_mainWindowLayout->addWidget(m_logo); m_logo->hide(); } QTimer::singleShot(0, this, SLOT(show()));//FIXME } else if(m_panelTurnedOn) QTimer::singleShot(0, this, SLOT(show()));//FIXME if((!m_alwaysShow || !m_autoHideTimeoutTimer) && m_logo) { m_logo->deleteLater(); m_logo = 0; } UPDATE_WINDOW_OPACITY(this); } if(m_mode == StandAlone || (!ScimKdeSettings::force_LeftToRight_In_Kicker() && m_mode == PanelEmbedded)) changeDirection((QBoxLayout::Direction)(ScimKdeSettings::mainWindow_Direction())); else changeDirection(QBoxLayout::LeftToRight); if(m_mode == StandAlone || (!m_alwaysShowExtensionHandle && m_mode == PanelEmbedded)) { resetToolbarSize(); } }
XADView::XADView(QWidget *parent, const char *name) : QWidget(parent, name) { setBackgroundMode(PaletteBase); }
Image::Image( QWidget *parent, const char *name, Qt::WFlags flag) : VtlWidget( parent, name, flag ) { setBackgroundMode( Qt::PaletteButton ); path = QDir::home().path(); }
WaWidget::WaWidget(int _mapping) : QWidget(WaSkin::instance()) { mapping = _mapping; setBackgroundMode(NoBackground); connect (WaSkinModel::instance(), SIGNAL(skinChanged()), this, SLOT(skinChanged())); }
ZLQtViewWidget::ZLQtViewWidgetInternal::ZLQtViewWidgetInternal(QWidget *parent, ZLQtViewWidget &holder) : QWidget(parent), myHolder(holder) { setBackgroundMode(NoBackground); }
Invisible( QWidgetStack * parent ): QWidget( parent, "qt_invisible_widgetstack" ) { setBackgroundMode( NoBackground ); }
Katalysator2View::Katalysator2View(QWidget *parent, const char *name) : QScrollView(parent, name) { setBackgroundMode(PaletteBase); }
LapsusPanelMain::LapsusPanelMain(KConfig* cfg, QWidget *parent, Qt::Orientation orientation): QWidget( parent ), _osd(cfg, this), _cfg(cfg), _orientation( orientation ) { _osd.enableDBus(); _layout = new FlowLayout(this, _orientation); _layout->setSpacing(4); setBackgroundMode(X11ParentRelative); _actions = new KActionCollection( this ); loadConfig(); int added = 0; // TODO - cleanup following mess ;) for ( QStringList::ConstIterator it = _panelEntries.begin(); it != _panelEntries.end(); ++it ) { LapsusPanelWidget *widget = LapsusFeatureManager::newPanelWidget( _cfg, *it, _orientation, this); if (widget) { ++added; _layout->add(widget); connect(widget, SIGNAL(rightButtonPressed()), this, SLOT(showContextMenu())); widget->show(); } } for ( QStringList::ConstIterator it = _menuEntries.begin(); it != _menuEntries.end(); ++it ) { QString str = *it; bool addedOK = false; if (!( KToggleAction* )_actions->action(str)) { addedOK = LapsusFeatureManager::newActionButton(_cfg, str, _actions); } } if (added < 1) { LapsusPanelWidget *widget = new LapsusPanelDefault( _orientation, this); connect(widget, SIGNAL(rightButtonPressed()), this, SLOT(showContextMenu())); _layout->add(widget); widget->show(); } }
UimToolbar::UimToolbar(QWidget *parent, const char *name, WFlags f) : QUimHelperToolbar(parent, name, f, true) { setBackgroundMode(X11ParentRelative); }
void KURLLabel::setTransparentMode(bool state) { m_transparent = state; setBackgroundMode(state ? NoBackground : PaletteBackground); }
QAquaFocusWidget::QAquaFocusWidget(bool noerase, QWidget *w) : QWidget(w, "magicFocusWidget", (noerase ? (WResizeNoErase | WRepaintNoErase) : 0)), d(NULL) { if(noerase) setBackgroundMode(NoBackground); }
void U2Panel::initWindowAttrs(){ cout<<"initWindowAttrs"<<endl; setWFlags(getWFlags()|Qt::WRepaintNoErase); setBackgroundMode(NoBackground); }