Ejemplo n.º 1
0
void
TabView::Draw(BRect updateRect)
{
	BRect frame(fLayoutItem->Frame());
	if (fIsFront) {
		// Extend the front tab outward left/right in order to merge
		// the frames of adjacent tabs.
		if (!fIsFirst)
			frame.left--;
		if (!fIsLast)
			frame.right++;

		frame.bottom++;
	}

	DrawBackground(fContainerView, frame, updateRect, fIsFirst, fIsLast,
		fIsFront);

	if (fIsFront) {
		frame.top += 3.0f;
		if (!fIsFirst)
			frame.left++;
		if (!fIsLast)
			frame.right--;
	} else
		frame.top += 6.0f;

	float spacing = be_control_look->DefaultLabelSpacing();
	frame.InsetBy(spacing, spacing / 2);
	DrawContents(fContainerView, frame, updateRect, fIsFirst, fIsLast,
		fIsFront);
}
Ejemplo n.º 2
0
//----------------------------
   virtual void Draw() const{
      super::Draw();
      app.DrawFormattedText(tdi);
      if(tdi.body_w.Length())
         app.DrawThickSeparator(rc.x+app.fdb.cell_size_x*3, rc.sx-app.fdb.cell_size_x*6, list.rc.y-app.fdb.line_spacing/2);

      DrawContents();
   }
Ejemplo n.º 3
0
void NowPlayingWidget::paintEvent(QPaintEvent* e) {
  QPainter p(this);

  DrawContents(&p);

  // Draw the previous track's image if we're fading
  if (!previous_track_.isNull()) {
    p.setOpacity(previous_track_opacity_);
    p.drawPixmap(0, 0, previous_track_);
  }
}
Ejemplo n.º 4
0
void C_mode_configuration::Draw() const{

   app.DrawTitleBar(app.GetText(title_text_id), rc.y);
   app.ClearSoftButtonsArea();

   DrawContents();

   const S_config_item &ec = options[selection];
   app.DrawSoftButtonsBar(*this, GetLeftSoftKey(ec), GetRightSoftKey(ec), text_editor);
   app.SetScreenDirty();
}
Ejemplo n.º 5
0
BOOLEAN NDAAction(EventRecord *sysEvent, int code)
{
    int event;
    static EventRecord localEvent;
    unsigned int eventCode;
    BOOLEAN result = FALSE;

    switch (code) {
    case runAction:
        return result;

    case eventAction:
        BlockMove((Pointer)sysEvent, (Pointer)&localEvent, 16);
        localEvent.wmTaskMask = 0x001FFFFF;
        eventCode = TaskMasterDA(0, &localEvent);
        switch(eventCode) {
        case updateEvt:
            BeginUpdate(gCalcWinPtr);
            DrawContents();
            EndUpdate(gCalcWinPtr);
            break;

        case wInControl:
            HandleControl(&localEvent);
            break;

        case keyDownEvt:
        case autoKeyEvt:
            HandleKey(&localEvent);
            break;
        }
        break;

    case cutAction:
    case copyAction:
    case pasteAction:
    case clearAction:
        result = TRUE;
        HandleMenu(code);
        break;
    }

    return result;
}
Ejemplo n.º 6
0
void NowPlayingWidget::SetImage(const QImage& image) {
  if (visible_) {
    // Cache the current pixmap so we can fade between them
    previous_track_ = QPixmap(size());
    previous_track_.fill(palette().background().color());
    previous_track_opacity_ = 1.0;
    QPainter p(&previous_track_);
    DrawContents(&p);
    p.end();
  }

  original_ = image;

  UpdateDetailsText();
  ScaleCover();
  SetVisible(true);

  // Were we waiting for this cover to load before we started fading?
  if (!previous_track_.isNull()) {
    fade_animation_->start();
  }
}