void ScrollView::resize(float newwidth, float newheight) { float scrollBarWidth = scrollBar().getComponent()->getWidth(); scrollBar().getComponent()->resize(scrollBarWidth, newheight); scrollBar().setPos(Vector2(newwidth - scrollBarWidth, 0)); float scrollarea = 0; if(contents().getComponent() != 0) { Component* component = contents().getComponent(); if(component->getFlags() & FLAG_RESIZABLE) component->resize(newwidth - scrollBarWidth, newheight); contents().setClipRect( Rect2D(0, 0, newwidth - scrollBarWidth, newheight)); scrollarea = component->getHeight() - newheight; if(scrollarea < 0) scrollarea = 0; } ScrollBar* scrollBarComponent = (ScrollBar*) scrollBar().getComponent(); scrollBarComponent->setRange(0, scrollarea); scrollBarComponent->setValue(0); width = newwidth; height = newheight; setDirty(); }
void ScrollView::event(const Event& event) { if(event.type == Event::MOUSEBUTTONDOWN && (event.mousebutton == SDL_BUTTON_WHEELUP || event.mousebutton == SDL_BUTTON_WHEELDOWN)) { if(!event.inside) return; ScrollBar* scrollBarComp = dynamic_cast<ScrollBar*> (scrollBar().getComponent()); if(scrollBarComp == 0) { #ifdef DEBUG assert(false); #endif return; } float val = - contents().getPos().y; if(event.mousebutton == SDL_BUTTON_WHEELUP) { val -= MOUSEWHEELSCROLL; if(val < 0) val = 0; } else { val += MOUSEWHEELSCROLL; if(val > scrollBarComp->getRangeMax()) val = scrollBarComp->getRangeMax(); } contents().setPos(Vector2(0, -val)); scrollBarComp->setValue(val); setDirty(); } Component::event(event); }
virtual void ApplySchemeSettings( vgui::IScheme *pScheme ) { BaseClass::ApplySchemeSettings( pScheme ); m_pTextEntryMovieTitle = dynamic_cast< TextEntry * >( FindChildByName( "MovieTitleTextEntry" ) ); m_pTextEntryMovieDesc = dynamic_cast< TextEntry * >( FindChildByName( "MovieDescTextEntry" ) ); // use insert, so that max characters is obeyed m_pTextEntryMovieTitle->InsertString( m_pMovie->GetItemTitle() ); // @todo add steam profile to description m_pTextEntryMovieDesc->SetText( "" ); m_pTextEntryMovieDesc->SetMultiline( true ); m_pTextEntryMovieDesc->SetCatchEnterKey( true ); m_pTextEntryMovieDesc->SetVerticalScrollbar( true ); ScrollBar *pScrollbar = dynamic_cast< ScrollBar* >( m_pTextEntryMovieDesc->FindChildByName( "Scrollbar" ) ); if ( pScrollbar ) { pScrollbar->SetAutohideButtons( false ); pScrollbar->SetScrollbarButtonsVisible( true ); } m_pUnlistedCheckbox = dynamic_cast< CheckButton * >( FindChildByName( "UnlistedCheckbox" ) ); if ( m_pUnlistedCheckbox ) { m_pUnlistedCheckbox->SetMouseInputEnabled( true ); } }
void SimpleList::keyPressEvent(QKeyEvent *event) { static QTime keyPressInterval = QTime::currentTime(); static qreal step = 0.0; static bool repeat = false; int interval = keyPressInterval.elapsed(); ScrollBar* sb = verticalScrollBar(); qreal currentValue = sb->sliderPosition(); if(interval < 250 ) { if(!repeat) step = 0.0; step = step + 2.0; if(step > 100) step = 100; repeat = true; } else { step = 1.0; if(itemAt(0)) step = itemAt(0)->size().height(); repeat = false; } if(event->key() == Qt::Key_Up ) { //Up Arrow sb->setSliderPosition(currentValue - step); } if(event->key() == Qt::Key_Down ) { //Down Arrow sb->setSliderPosition(currentValue + step); } keyPressInterval.start(); }
void CDialog_RendertargetList::FillList() { ScrollBar *pScroll = m_pList_RT->GetScrollbar(); int scrollValue = pScroll ? pScroll->GetValue() : 0; m_pList_RT->DeleteAllItems(); GetRTManager()->SortRTsByName(); for ( int i = 0; i < GetRTManager()->GetNumRTs(); i++ ) { RTDef *rt = GetRTManager()->GetRT( i ); if ( rt->IsFlaggedForDeletion() ) continue; Label *pL = new Label( m_pList_RT, "", rt->GetName() ); Button *pBDel = new Button( m_pList_RT, "", "Delete", this, VarArgs("del_rt_%i",i) ); Button *pBEdit = new Button( m_pList_RT, "", "Edit", this, VarArgs("edit_rt_%i",i) ); pBDel->SetContentAlignment( Label::a_center ); pBEdit->SetContentAlignment( Label::a_center ); m_pList_RT->AddItem( pL, pBDel ); m_pList_RT->AddItem( NULL, pBEdit ); } if ( pScroll ) pScroll->SetValue( scrollValue ); }
//============================================================================== void BasicFileBrowser::resized() { const int height = getHeight(); const int width = getWidth(); FileListComponent* list = dynamic_cast<FileListComponent*> (fileListComponent.get()); if (list != nullptr) { list->setBounds (0, 0, width, height); ScrollBar *bar = list->getVerticalScrollBar(); const int size = roundToInt (bar->getWidth() * 1.5f); if (showResizer) { bar->setTransform (AffineTransform::scale (1, (height - (float) size) / height)); resizeLimits.setSizeLimits (150, height, 1600, height); resizer->setBounds (roundToInt (width - size * (2.0f / 3.0f)), height - size, roundToInt (size * (2.0f / 3.0f)), size); } else { bar->setTransform (AffineTransform::identity); } } }
void TextArea::OnMouseDown(unsigned short /*x*/, unsigned short /*y*/, unsigned short Button, unsigned short /*Mod*/) { ScrollBar* scrlbr = (ScrollBar*) sb; if (!scrlbr) { Control *ctrl = Owner->GetScrollControl(); if (ctrl && (ctrl->ControlType == IE_GUI_SCROLLBAR)) { scrlbr = (ScrollBar *) ctrl; } } if (scrlbr) { switch(Button) { case GEM_MB_SCRLUP: scrlbr->ScrollUp(); core->RedrawAll(); break; case GEM_MB_SCRLDOWN: scrlbr->ScrollDown(); core->RedrawAll(); break; } } }
ScrollBar* FindScrollBarNamed(const ParsedMui& muiInfo, const char* name) { for (size_t i = 0; i < muiInfo.scrollBars.size(); i++) { ScrollBar* c = muiInfo.scrollBars.at(i); if (c->IsNamed(name)) return c; } return nullptr; }
ScrollBar *FindScrollBarNamed(const ParsedMui& muiInfo, const char *name) { for (size_t i = 0; i < muiInfo.scrollBars.Count(); i++) { ScrollBar *c = muiInfo.scrollBars.At(i); if (c->IsNamed(name)) return c; } return NULL; }
/** Mouse Button Down */ void Button::OnMouseDown(unsigned short x, unsigned short y, unsigned short Button, unsigned short Mod) { if (State == IE_GUI_BUTTON_DISABLED) { Control::OnMouseDown(x,y,Button,Mod); return; } if (core->GetDraggedItem () && !ButtonOnDragDrop) { Control::OnMouseDown(x,y,Button,Mod); return; } ScrollBar* scrlbr = (ScrollBar*) sb; if (!scrlbr) { Control *ctrl = Owner->GetScrollControl(); if (ctrl && (ctrl->ControlType == IE_GUI_SCROLLBAR)) { scrlbr = (ScrollBar *) ctrl; } } //Button == 1 means Left Mouse Button switch(Button&GEM_MB_NORMAL) { case GEM_MB_ACTION: // We use absolute screen position here, so drag_start // remains valid even after window/control is moved drag_start.x = Owner->XPos + XPos + x; drag_start.y = Owner->YPos + YPos + y; if (State == IE_GUI_BUTTON_LOCKED) { SetState( IE_GUI_BUTTON_LOCKED_PRESSED ); return; } SetState( IE_GUI_BUTTON_PRESSED ); if (Flags & IE_GUI_BUTTON_SOUND) { core->PlaySound( DS_BUTTON_PRESSED ); } if ((Button & GEM_MB_DOUBLECLICK) && ButtonOnDoublePress) { RunEventHandler( ButtonOnDoublePress ); printMessage("Button","Doubleclick detected\n",GREEN); } break; case GEM_MB_SCRLUP: if (scrlbr) { scrlbr->ScrollUp(); core->RedrawAll(); } break; case GEM_MB_SCRLDOWN: if (scrlbr) { scrlbr->ScrollDown(); core->RedrawAll(); } break; } }
FoldablePanel::FoldablePanel (const String& name) : Component (name) { addAndMakeVisible (viewport); viewport.setViewedComponent (panelHolderComponent = new PanelHolderComponent()); viewport.setScrollBarsShown(true, false, false, false); ScrollBar* scrollbarY = viewport.getVerticalScrollBar(); scrollbarY->setAutoHide(false); viewport.setScrollBarThickness(10); viewport.setFocusContainer(true); }
int main() { // IMPORTANT: Object is declared const const ScrollBar bar(60, "Window1"); //bar.setSize(100); // cannot do this to const obj bar.setOwner("Window2"); // this is ok since mutable cout << bar.getSize() << ", " << bar.getOwner() << endl; return 0; }
static ScrollBar* ScrollBarFromDef(TxtNode* structDef) { CrashIf(!structDef->IsStructWithName("ScrollBar")); ScrollBarDef* def = DeserializeScrollBarDef(structDef); ScrollBar* sb = new ScrollBar(); Style* style = StyleByName(def->style); sb->SetStyle(style); sb->SetName(def->name); // TODO: support def->cursor FreeScrollBarDef(def); return sb; }
//------- Begin of function TxtList::detect_text -------// //! //! Return : <int> 1 - detected //! 0 - not detected //! int TxtList::detect_text() { //------- if mouse pressed on text area ------// //-- can pressed on hyper-texted field or just fast scrolling --// if( !mouse.single_click( text_x1, text_y1, text_x2, text_y2 ) ) return 0; //---- detect hyper-texted field ------// int i, topicId; char saveChar; HyperField* hyperField = font_letter.hyper_field_array; for( i=0 ; i<font_letter.hyper_field_count ; i++, hyperField++ ) { if( mouse.click_x() >= hyperField->x1 && mouse.click_x() <= hyperField->x2 && mouse.click_y() >= hyperField->y1 && mouse.click_y() <= hyperField->y2 ) { err_when( hyperField->text_len > TxtIndex::TITLE_LEN ); saveChar = hyperField->text_ptr[hyperField->text_len]; hyperField->text_ptr[hyperField->text_len] = NULL; topicId = res_txt.locate_topic(hyperField->text_ptr); hyperField->text_ptr[hyperField->text_len] = saveChar; if( topicId ) { add_history(topic_id); // add current topic id to the history disp(INFO_UPDATE, topicId); sys.redraw_all_flag=1; if( init_list_flag ) topic_browse.refresh( topicId ); return 1; } } } //------ detect fast scrolling --------// if( mouse.click_y() < text_y1 + (text_y2-text_y1) / 2 ) top_line = scroll_bar.page_up(1); // page up, 1 = skip less one line, so when scrolling text, want the last line of previous page be the first line of current page, then pass 1 as skipLess else top_line = scroll_bar.page_down(1); // page down disp(INFO_UPDATE); return 1; }
void Button::OnMouseWheelScroll(short x, short y) { ScrollBar* scrlbr = (ScrollBar*) sb; if (!scrlbr) { Control *ctrl = Owner->GetScrollControl(); if (ctrl && (ctrl->ControlType == IE_GUI_SCROLLBAR)) { scrlbr = (ScrollBar *) ctrl; } } if (scrlbr) { scrlbr->OnMouseWheelScroll(x, y); } }
ScrollBar* ScrollBar::create( CCScrollView* sv, int type ) { ScrollBar *pReturn = new ScrollBar( sv, type ); if( pReturn ) { pReturn->autorelease(); return pReturn; } else { delete pReturn; return NULL; } }
ScrollBar* PanelContainer::makeScrollBar(Ogre::Real x, Ogre::Real y, size_t width, size_t height, Ogre::Real minValue, Ogre::Real maxValue) { ScrollBar* scrollBar = new ScrollBar(x, y, width, height, minValue, maxValue, this); scrollBar->setCursorSprites(getPanelColors()->scrollbarCursorOveredSpriteName, getPanelColors()->scrollbarCursorNotOveredSpriteName, getPanelColors()->scrollbarCursorSelectedSpriteName); addItem(scrollBar); return scrollBar; }
ScrollBar * ScrollBar::create(Scale9Sprite * bar_bg,Scale9Sprite * bar_slider,TableView * tableView,SclBarDirection dir) { ScrollBar * pRet = new ScrollBar(); if (pRet && pRet->myInit(bar_bg,bar_slider,tableView,dir)) { pRet->autorelease(); } else { CC_SAFE_DELETE(pRet); } return pRet; }
//------- Begin of function TxtList::detect -------// //! //! Return : <int> 1 - detected //! 0 - not detected //! int TxtList::detect() { int rc; //------- detect topic list list ----------// // vga.use_front(); // select new topic if( init_list_flag && (rc=topic_browse.detect()) > 0 ) { double_clicked=topic_browse.double_click; topic_id=rc; sys.redraw_all_flag=1; // disp(INFO_UPDATE, rc); return 1; } if(!init_list_flag) { if( (rc=scroll_bar.detect()) > 0 ) { //-------- detect text scroll bar ----------// top_line = rc; sys.redraw_all_flag=1; disp(INFO_UPDATE); return 1; //------- detect on text body ---------// } if( detect_text() ) return 1; } return 0; }
void IntrojucerLookAndFeel::drawScrollbar (Graphics& g, ScrollBar& scrollbar, int x, int y, int width, int height, bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) { Path thumbPath; if (thumbSize > 0) { const float thumbIndent = (isScrollbarVertical ? width : height) * 0.25f; const float thumbIndentx2 = thumbIndent * 2.0f; if (isScrollbarVertical) thumbPath.addRoundedRectangle (x + thumbIndent, thumbStartPosition + thumbIndent, width - thumbIndentx2, thumbSize - thumbIndentx2, (width - thumbIndentx2) * 0.5f); else thumbPath.addRoundedRectangle (thumbStartPosition + thumbIndent, y + thumbIndent, thumbSize - thumbIndentx2, height - thumbIndentx2, (height - thumbIndentx2) * 0.5f); } Colour thumbCol (scrollbar.findColour (ScrollBar::thumbColourId, true)); if (isMouseOver || isMouseDown) thumbCol = thumbCol.withMultipliedAlpha (2.0f); g.setColour (thumbCol); g.fillPath (thumbPath); g.setColour (thumbCol.contrasting ((isMouseOver || isMouseDown) ? 0.2f : 0.1f)); g.strokePath (thumbPath, PathStrokeType (1.0f)); }
void ComboBox::set_in_window() { Container::set_in_window(); popup = GUI_NEW( Window(get_window(),Window::MODE_POPUP) ); hbc = GUI_NEW( HBCCombo ); popup->set_root_frame( hbc ); hbc->add( list, 1); list->set_cursor_hint( true ); ScrollBar *sb = hbc->add( GUI_NEW( ScrollBar(VERTICAL)), 0); sb->set_range( list->get_range() ); sb->set_auto_hide( true ); list->selected_signal.connect( this, &ComboBox::list_selection_changed_slot ); }
void TweakScroller::Init(Panel *pParent, char *pText, int yPos) { int parentWidth, parentHeight; pParent->getSize(parentWidth, parentHeight); // Setup the volume scroll bar. m_Label.setParent(pParent); m_Label.setFont(Scheme::sf_primary1); m_Label.setContentAlignment(vgui::Label::a_northwest); m_Label.setBgColor(0, 0, 0, 255); m_Label.setFgColor(255,255,255,0); m_Label.setPos(ITEM_BORDER, yPos); m_Label.setSize(parentWidth/2-ITEM_BORDER, 20); m_Label.setText(pText); m_Label.setVisible(true); m_Slider.setRangeWindow(10); m_Slider.setRangeWindowEnabled(true); m_Scroll.setPos(parentWidth/2+ITEM_BORDER, yPos); m_Scroll.setSize(parentWidth/2-ITEM_BORDER*2, 20); m_Scroll.setSlider(&m_Slider); m_Scroll.setParent(pParent); m_Scroll.setRange(0, 100); m_Scroll.setFgColor(255,255,255,0); m_Scroll.setBgColor(255,255,255,0); }
gcc_pure PixelRect item_rect(unsigned i) const { PixelRect rc; rc.left = 0; rc.top = (int)(i - origin) * item_height - pixel_pan; rc.right = scroll_bar.get_left(get_size()); rc.bottom = rc.top + item_height; return rc; }
void Window::RedrawControls(const char* VarName, unsigned int Sum) { for (unsigned int i = 0; i < Controls.size(); i++) { switch (Controls[i]->ControlType) { case IE_GUI_MAP: { MapControl *mc = ( MapControl* ) (Controls[i]); mc->RedrawMapControl( VarName, Sum ); break; } case IE_GUI_BUTTON: { Button* bt = ( Button* ) ( Controls[i] ); bt->RedrawButton( VarName, Sum ); break; } case IE_GUI_TEXTAREA: { TextArea* pb = ( TextArea* ) ( Controls[i] ); pb->RedrawTextArea( VarName, Sum ); break; } case IE_GUI_PROGRESSBAR: { Progressbar* pb = ( Progressbar* ) ( Controls[i] ); pb->RedrawProgressbar( VarName, Sum ); break; } case IE_GUI_SLIDER: { Slider* sl = ( Slider* ) ( Controls[i] ); sl->RedrawSlider( VarName, Sum ); break; } case IE_GUI_SCROLLBAR: { ScrollBar* sb = ( ScrollBar* ) ( Controls[i] ); sb->RedrawScrollBar( VarName, Sum ); break; } } } }
void CDialog_PPEPrecache::FillList() { ScrollBar *pScroll = m_pList_Effects->GetScrollbar(); int scrollValue = pScroll ? pScroll->GetValue() : 0; m_pList_Effects->DeleteAllItems(); GetPPCache()->ClearInvalidEntries(); HFont fontMarlett = scheme()->GetIScheme( GetScheme() )->GetFont( "Marlett", false ); for ( int i = 0; i < GetPPCache()->GetNumPostProcessingEffects(); i++ ) { EditorPostProcessingEffect *effect = GetPPCache()->GetPostProcessingEffect( i ); Label *pL = new Label( m_pList_Effects, "", effect->pszName ); Button *pDel = new Button( m_pList_Effects, "", "Delete", this, VarArgs("del_effect_%i",i) ); CheckButton *pCheck = new CheckButton( m_pList_Effects, effect->pszName, "" ); pCheck->AddActionSignalTarget( this ); pCheck->SetSelected( effect->bStartEnabled ); Button *pDown = new Button( m_pList_Effects, "", "u", this, VarArgs("movedown_effect_%i",i) ); Button *pUp = new Button( m_pList_Effects, "", "t", this, VarArgs("moveup_effect_%i",i) ); pDown->SetFont( fontMarlett ); pUp->SetFont( fontMarlett ); pDel->SetContentAlignment( Label::a_center ); pDown->SetContentAlignment( Label::a_center ); pUp->SetContentAlignment( Label::a_center ); m_pList_Effects->AddItem( NULL, pCheck ); m_pList_Effects->AddItem( NULL, pDown ); m_pList_Effects->AddItem( NULL, pUp ); m_pList_Effects->AddItem( pL, pDel ); } if ( pScroll ) pScroll->SetValue( scrollValue ); }
void LunarMainWindow::buildGui() { m_centralWidget = new QWidget; m_gameInfo = new GameInfoWidget(this); m_mainSplitter = new QSplitter; StyleSheetManager ssm(this); m_gameList = new ListView(this); if(!ssm.load("VerticalScrollBar")) qDebug() << "Unable to open VerticalScrollBar.css" << endl; ScrollBar *vScrollBar = new ScrollBar(this); ScrollBar *hScrollBar = new ScrollBar(this); vScrollBar->setStyleSheet(ssm.get()); if(!ssm.load("HorizontalScrollBar")) qDebug() << "Unable to open HorizontalScrollBar.css" << endl; hScrollBar->setStyleSheet(ssm.get()); m_gameList->setVerticalScrollBar(vScrollBar); m_gameList->setHorizontalScrollBar(hScrollBar); m_overviewStack = new QStackedWidget; m_overviewStack->addWidget(m_gameInfo); m_gameList->setMaximumWidth(280); m_gameList->resize(200, m_gameList->height()); QHBoxLayout *hbox = new QHBoxLayout; m_mainSplitter->addWidget(m_gameList); m_mainSplitter->addWidget(m_overviewStack); hbox->addWidget(m_mainSplitter); m_centralWidget->setLayout(hbox); this->setCentralWidget(m_centralWidget); }
void TextArea::UpdateControls() { int pos; CalcRowCount(); Changed = true; if (sb) { ScrollBar* bar = ( ScrollBar* ) sb; if (Flags & IE_GUI_TEXTAREA_AUTOSCROLL) pos = rows - ( ( Height - 5 ) / ftext->maxHeight ); else pos = 0; if (pos < 0) pos = 0; bar->SetPos( pos ); } else { if (Flags & IE_GUI_TEXTAREA_AUTOSCROLL) { pos = rows - ( ( Height - 5 ) / ftext->maxHeight ); SetRow(pos); } } core->RedrawAll(); }
void ScrollerPrivate::updateScrolling() { bool scrollOngoing = false; if (!m_scrollArea) { m_scrollTimer.stop(); return; } if (m_state == ManualScrolling) { scrollOngoing = true; m_speed = mapToScrollArea(QCursor::pos()) - mapToScrollArea(m_cursorPos); m_cursorPos = QCursor::pos(); } else if (m_state == AutoScrolling) { scrollOngoing = true; qreal x = qMax(-MaxScrollingSpeed, qMin(m_speed.x(), MaxScrollingSpeed)); qreal y = qMax(-MaxScrollingSpeed, qMin(m_speed.y(), MaxScrollingSpeed)); int sinceLast = m_lastFrameTime.elapsed(); int slowdown = (ScrollStep * sinceLast) + m_scrollSlowAccum; m_scrollSlowAccum = slowdown & 0x3F; slowdown >>= 6; if (x > 0) x= qMax(qreal(0.0), x - slowdown); else x = qMin(qreal(0.0), x + slowdown); if (y > 0) y = qMax(qreal(0.0), y - slowdown); else y = qMin(qreal(0.0), y + slowdown); m_speed = QPoint(x,y); if (m_speed != QPoint(0,0)) { QPointF d; int xstep = (int(m_speed.x()) * sinceLast)>>6; // >>6 ~= *60 /1000 (==*64 /1024) int ystep = (int(m_speed.y()) * sinceLast)>>6; //qDebug() << sinceLast << "speedy" << speed.y()<<"ystep" << ystep; QPoint step = QPoint(xstep,ystep); if (ystep > 0) d = (m_scrollArea->pos() + step); else d = -(m_scrollArea->pos() - step); ScrollBar *hscroll = m_scrollArea->horizontalScrollBar(); ScrollBar *vscroll = m_scrollArea->verticalScrollBar(); hscroll->setSliderPosition(hscroll->sliderPosition() - m_scrollFactor * d.x()); vscroll->setSliderPosition(vscroll->sliderPosition() - m_scrollFactor * d.y()); } else {
void OldSchoolLookAndFeel::drawScrollbarButton (Graphics& g, ScrollBar& bar, int width, int height, int buttonDirection, bool isScrollbarVertical, bool isMouseOverButton, bool isButtonDown) { if (isScrollbarVertical) width -= 2; else height -= 2; Path p; if (buttonDirection == 0) p.addTriangle (width * 0.5f, height * 0.2f, width * 0.1f, height * 0.7f, width * 0.9f, height * 0.7f); else if (buttonDirection == 1) p.addTriangle (width * 0.8f, height * 0.5f, width * 0.3f, height * 0.1f, width * 0.3f, height * 0.9f); else if (buttonDirection == 2) p.addTriangle (width * 0.5f, height * 0.8f, width * 0.1f, height * 0.3f, width * 0.9f, height * 0.3f); else if (buttonDirection == 3) p.addTriangle (width * 0.2f, height * 0.5f, width * 0.7f, height * 0.1f, width * 0.7f, height * 0.9f); if (isButtonDown) g.setColour (Colours::white); else if (isMouseOverButton) g.setColour (Colours::white.withAlpha (0.7f)); else g.setColour (bar.findColour (ScrollBar::thumbColourId).withAlpha (0.5f)); g.fillPath (p); g.setColour (Colours::black.withAlpha (0.5f)); g.strokePath (p, PathStrokeType (0.5f)); }
void updateCursorPosition() { currentPositionMarker.setVisible (transportSource.isPlaying() || isMouseButtonDown()); currentPositionMarker.setRectangle (Rectangle<float> (timeToX (transportSource.getCurrentPosition()) - 0.75f, 0, 1.5f, (float) (getHeight() - scrollbar.getHeight()))); }