void ButtonSet::Item::onPaint(ui::PaintEvent& ev) { SkinTheme* theme = static_cast<SkinTheme*>(getTheme()); Graphics* g = ev.getGraphics(); gfx::Rect rc = getClientBounds(); gfx::Color face; int nw; if (!gfx::is_transparent(getBgColor())) g->fillRect(getBgColor(), g->getClipBounds()); if (isSelected() || hasMouseOver()) { nw = PART_TOOLBUTTON_HOT_NW; face = theme->getColor(ThemeColor::ButtonHotFace); } else { nw = PART_TOOLBUTTON_LAST_NW; face = theme->getColor(ThemeColor::ButtonNormalFace); } Grid::Info info = buttonSet()->getChildInfo(this); if (info.col < info.grid_cols-1) rc.w+=1*jguiscale(); if (info.row < info.grid_rows-1) rc.h+=3*jguiscale(); theme->draw_bounds_nw(g, rc, nw, face); if (m_icon) { g->drawRgbaSurface(m_icon, rc.x + rc.w/2 - m_icon->width()/2, rc.y + rc.h/2 - m_icon->height()/2); } }
void ColorSpectrum::onPaint(ui::PaintEvent& ev) { ui::Graphics* g = ev.graphics(); SkinTheme* theme = static_cast<SkinTheme*>(this->theme()); theme->drawRect(g, clientBounds(), theme->parts.editorNormal().get(), bgColor()); gfx::Rect rc = clientChildrenBounds(); if (rc.isEmpty()) return; int vmid = (align() & HORIZONTAL ? rc.h/2 : rc.w/2); vmid = MAX(1, vmid); for (int y=0; y<rc.h; ++y) { for (int x=0; x<rc.w; ++x) { int u, v, umax; if (align() & HORIZONTAL) { u = x; v = y; umax = MAX(1, rc.w-1); } else { u = y; v = x; umax = MAX(1, rc.h-1); } double hue = 360.0 * u / umax; double sat = (v < vmid ? 100.0 * v / vmid : 100.0); double val = (v < vmid ? 100.0 : 100.0-(100.0 * (v-vmid) / vmid)); gfx::Color color = color_utils::color_for_ui( app::Color::fromHsv( MID(0.0, hue, 360.0), MID(0.0, sat, 100.0), MID(0.0, val, 100.0))); g->putPixel(color, rc.x+x, rc.y+y); } } if (m_color.getType() != app::Color::MaskType) { double hue = m_color.getHue(); double sat = m_color.getSaturation(); double val = m_color.getValue(); double lit = (200.0 - sat) * val / 200.0; gfx::Point pos(rc.x + int(hue * rc.w / 360.0), rc.y + rc.h - int(lit * rc.h / 100.0)); she::Surface* icon = theme->parts.colorWheelIndicator()->bitmap(0); g->drawColoredRgbaSurface( icon, lit > 50.0 ? gfx::rgba(0, 0, 0): gfx::rgba(255, 255, 255), pos.x-icon->width()/2, pos.y-icon->height()/2); } }
void ColorBar::ScrollableView::onPaint(ui::PaintEvent& ev) { ui::Graphics* g = ev.getGraphics(); SkinTheme* theme = static_cast<SkinTheme*>(getTheme()); theme->draw_bounds_nw(g, getClientBounds(), hasFocus() ? PART_EDITOR_SELECTED_NW: PART_EDITOR_NORMAL_NW, ColorNone); }
void ColorWheel::onPaint(ui::PaintEvent& ev) { ui::Graphics* g = ev.getGraphics(); SkinTheme* theme = static_cast<SkinTheme*>(getTheme()); theme->drawRect(g, getClientBounds(), theme->parts.editorNormal().get(), getBgColor()); const gfx::Rect& rc = m_clientBounds; for (int y=rc.y; y<rc.y+rc.h; ++y) { for (int x=rc.x; x<rc.x+rc.w; ++x) { app::Color appColor = ColorWheel::pickColor(gfx::Point(x, y)); gfx::Color color; if (appColor.getType() != app::Color::MaskType) { color = color_utils::color_for_ui(appColor); } else { color = theme->colors.editorFace(); } g->putPixel(color, x, y); } } if (m_mainColor.getAlpha() > 0) { int n = getHarmonies(); int boxsize = MIN(rc.w/10, rc.h/10); for (int i=0; i<n; ++i) { app::Color color = getColorInHarmony(i); int hue = color.getHue()-30; int sat = color.getSaturation(); gfx::Point pos = m_wheelBounds.getCenter() + gfx::Point(int(+std::cos(PI*hue/180)*double(m_wheelRadius)*sat/100.0), int(-std::sin(PI*hue/180)*double(m_wheelRadius)*sat/100.0)); she::Surface* icon = theme->parts.colorWheelIndicator()->getBitmap(0); g->drawRgbaSurface(icon, pos.x-icon->width()/2, pos.y-icon->height()/2); g->fillRect(gfx::rgba(color.getRed(), color.getGreen(), color.getBlue(), 255), gfx::Rect(rc.x+rc.w-(n-i)*boxsize, rc.y+rc.h-boxsize, boxsize, boxsize)); } } }
void SearchEntry::onPaint(ui::PaintEvent& ev) { SkinTheme* theme = static_cast<SkinTheme*>(this->theme()); theme->paintEntry(ev); auto icon = theme->parts.iconSearch()->bitmap(0); Rect bounds = clientBounds(); ev.graphics()->drawColoredRgbaSurface( icon, theme->colors.text(), bounds.x + border().left(), bounds.y + bounds.h/2 - icon->height()/2); if (!text().empty()) { icon = theme->parts.iconClose()->bitmap(0); ev.graphics()->drawColoredRgbaSurface( icon, theme->colors.text(), bounds.x + bounds.w - border().right() - childSpacing() - icon->width(), bounds.y + bounds.h/2 - icon->height()/2); } }
void ColorCurveEditor::onPaint(ui::PaintEvent& ev) { ui::Graphics* g = ev.graphics(); gfx::Rect rc = clientBounds(); gfx::Rect client = clientChildrenBounds(); gfx::Point pt; int c; g->fillRect(gfx::rgba(0, 0, 0), rc); g->drawRect(gfx::rgba(255, 255, 0), rc); // Draw guides for (c=1; c<=3; c++) g->drawVLine(gfx::rgba(128, 128, 0), c*client.w/4, client.y, client.h); for (c=1; c<=3; c++) g->drawHLine(gfx::rgba(128, 128, 0), client.x, c*client.h/4, client.w); // Get curve values std::vector<int> values(m_viewBounds.w); m_curve->getValues(m_viewBounds.x, m_viewBounds.x+m_viewBounds.w-1, values); // Draw curve for (c = client.x; c < client.x+client.w; ++c) { pt = clientToView(gfx::Point(c, 0)); pt.x = MID(m_viewBounds.x, pt.x, m_viewBounds.x+m_viewBounds.w-1); pt.y = values[pt.x - m_viewBounds.x]; pt.y = MID(m_viewBounds.y, pt.y, m_viewBounds.y+m_viewBounds.h-1); pt = viewToClient(pt); g->putPixel(gfx::rgba(255, 255, 255), c, pt.y); } // Draw nodes for (const gfx::Point& point : *m_curve) { pt = viewToClient(point); gfx::Rect box(0, 0, 5*guiscale(), 5*guiscale()); box.offset(pt.x-box.w/2, pt.y-box.h/2); g->drawRect(gfx::rgba(0, 0, 255), box); if (m_editPoint == &point) { box.enlarge(4*guiscale()); g->drawRect(gfx::rgba(255, 255, 0), box); } else if (m_hotPoint == &point) { box.enlarge(2*guiscale()); g->drawRect(gfx::rgba(255, 255, 0), box); } } }
void PaletteView::onPaint(ui::PaintEvent& ev) { ui::Graphics* g = ev.getGraphics(); gfx::Rect bounds = getClientBounds(); div_t d = div(Palette::MaxColors, m_columns); int cols = m_columns; int rows = d.quot + ((d.rem)? 1: 0); int x, y, u, v; int c, color; Palette* palette = get_current_palette(); gfx::Color bordercolor = gfx::rgba(255, 255, 255); g->fillRect(gfx::rgba(0 , 0, 0), bounds); y = bounds.y + this->border_width.t; c = 0; for (v=0; v<rows; v++) { x = bounds.x + this->border_width.l; for (u=0; u<cols; u++) { if (c >= palette->size()) break; color = gfx::rgba( rgba_getr(palette->getEntry(c)), rgba_getg(palette->getEntry(c)), rgba_getb(palette->getEntry(c))); g->fillRect(color, gfx::Rect(x, y, m_boxsize, m_boxsize)); if (m_selectedEntries[c]) { const int max = Palette::MaxColors; bool top = (c >= m_columns && c-m_columns >= 0 ? m_selectedEntries[c-m_columns]: false); bool bottom = (c < max-m_columns && c+m_columns < max ? m_selectedEntries[c+m_columns]: false); bool left = ((c%m_columns)>0 && c-1 >= 0 ? m_selectedEntries[c-1]: false); bool right = ((c%m_columns)<m_columns-1 && c+1 < max ? m_selectedEntries[c+1]: false); if (!top ) g->drawHLine(bordercolor, x-1, y-1, m_boxsize+2); if (!bottom) g->drawHLine(bordercolor, x-1, y+m_boxsize, m_boxsize+2); if (!left ) g->drawVLine(bordercolor, x-1, y-1, m_boxsize+2); if (!right ) g->drawVLine(bordercolor, x+m_boxsize, y-1, m_boxsize+2); } x += m_boxsize+this->child_spacing; c++; } y += m_boxsize+this->child_spacing; } }
void StatusBar::onPaint(ui::PaintEvent& ev) { SkinTheme* theme = static_cast<SkinTheme*>(this->getTheme()); gfx::Color textColor = theme->getColorById(kStatusBarText); Rect rc = getClientBounds(); Graphics* g = ev.getGraphics(); g->fillRect(getBgColor(), rc); rc.shrink(Border(2, 1, 2, 2)*guiscale()); int x = rc.x + 4*guiscale(); // Color if (m_state == SHOW_COLOR) { // Draw eyedropper icon she::Surface* icon = theme->get_toolicon("eyedropper"); if (icon) { g->drawRgbaSurface(icon, x, rc.y + rc.h/2 - icon->height()/2); x += icon->width() + 4*guiscale(); } // Draw color draw_color_button(g, gfx::Rect(x, rc.y, 32*guiscale(), rc.h), m_color, false, false); x += (32+4)*guiscale(); // Draw color description std::string str = m_color.toHumanReadableString(app_get_current_pixel_format(), app::Color::LongHumanReadableString); if (m_alpha < 255) { char buf[256]; sprintf(buf, " \xCE\xB1%d", m_alpha); str += buf; } g->drawString(str, textColor, ColorNone, gfx::Point(x, rc.y + rc.h/2 - getFont()->height()/2)); x += getFont()->textLength(str.c_str()) + 4*guiscale(); } // Show tool if (m_state == SHOW_TOOL) { // Draw eyedropper icon she::Surface* icon = theme->get_toolicon(m_tool->getId().c_str()); if (icon) { g->drawRgbaSurface(icon, x, rc.y + rc.h/2 - icon->height()/2); x += icon->width() + 4*guiscale(); } } // Status bar text if (getTextLength() > 0) { g->drawString(getText(), textColor, ColorNone, gfx::Point(x, rc.y + rc.h/2 - getFont()->height()/2)); x += getFont()->textLength(getText().c_str()) + 4*guiscale(); } }
void ToolBar::onPaint(ui::PaintEvent& ev) { gfx::Rect bounds = getClientBounds(); Graphics* g = ev.getGraphics(); SkinTheme* theme = static_cast<SkinTheme*>(this->getTheme()); gfx::Color normalFace = theme->getColor(ThemeColor::ButtonNormalFace); gfx::Color hotFace = theme->getColor(ThemeColor::ButtonHotFace); ToolBox* toolbox = App::instance()->getToolBox(); ToolGroupList::iterator it = toolbox->begin_group(); int groups = toolbox->getGroupsCount(); Rect toolrc; g->fillRect(theme->getColor(ThemeColor::TabSelectedFace), bounds); for (int c=0; c<groups; ++c, ++it) { ToolGroup* tool_group = *it; Tool* tool = m_selectedInGroup[tool_group]; gfx::Color face; int nw; if (UIContext::instance()->settings()->getCurrentTool() == tool || m_hotIndex == c) { nw = PART_TOOLBUTTON_HOT_NW; face = hotFace; } else { nw = c >= 0 && c < groups-1 ? PART_TOOLBUTTON_NORMAL_NW: PART_TOOLBUTTON_LAST_NW; face = normalFace; } toolrc = getToolGroupBounds(c); toolrc.offset(-getBounds().x, -getBounds().y); theme->draw_bounds_nw(g, toolrc, nw, face); // Draw the tool icon she::Surface* icon = theme->get_toolicon(tool->getId().c_str()); if (icon) { g->drawRgbaSurface(icon, toolrc.x+toolrc.w/2-icon->width()/2, toolrc.y+toolrc.h/2-icon->height()/2); } } // Draw button to show tool configuration toolrc = getToolGroupBounds(ConfigureToolIndex); toolrc.offset(-getBounds().x, -getBounds().y); bool isHot = (m_hotIndex == ConfigureToolIndex); theme->draw_bounds_nw(g, toolrc, isHot ? PART_TOOLBUTTON_HOT_NW: PART_TOOLBUTTON_LAST_NW, isHot ? hotFace: normalFace); she::Surface* icon = theme->get_toolicon("configuration"); if (icon) { g->drawRgbaSurface(icon, toolrc.x+toolrc.w/2-icon->width()/2, toolrc.y+toolrc.h/2-icon->height()/2); } // Draw button to show/hide mini editor toolrc = getToolGroupBounds(MiniEditorVisibilityIndex); toolrc.offset(-getBounds().x, -getBounds().y); isHot = (m_hotIndex == MiniEditorVisibilityIndex || App::instance()->getMainWindow()->getMiniEditor()->isMiniEditorEnabled()); theme->draw_bounds_nw(g, toolrc, isHot ? PART_TOOLBUTTON_HOT_NW: PART_TOOLBUTTON_LAST_NW, isHot ? hotFace: normalFace); icon = theme->get_toolicon("minieditor"); if (icon) { g->drawRgbaSurface(icon, toolrc.x+toolrc.w/2-icon->width()/2, toolrc.y+toolrc.h/2-icon->height()/2); } }
void ColorShades::onPaint(ui::PaintEvent& ev) { auto theme = skin::SkinTheme::instance(); ui::Graphics* g = ev.graphics(); gfx::Rect bounds = clientBounds(); theme->paintWidget(g, this, style(), bounds); bounds.shrink(3*ui::guiscale()); gfx::Rect box(bounds.x, bounds.y, m_boxSize*ui::guiscale(), bounds.h); Shade colors = getShade(); if (colors.size() >= 2) { gfx::Rect hotBounds; int j = 0; for (int i=0; box.x<bounds.x2(); ++i, box.x += box.w) { // Make the last box a little bigger to just use all // available size if (i == int(colors.size())-1) { if (bounds.x+bounds.w-box.x <= m_boxSize+m_boxSize/2) box.w = bounds.x+bounds.w-box.x; } app::Color color; if (m_dragIndex >= 0 && m_hotIndex == i) { color = colors[m_dragIndex]; } else { if (j == m_dragIndex) { ++j; } if (j < int(colors.size())) color = colors[j++]; else color = app::Color::fromMask(); } draw_color(g, box, color, (doc::ColorMode)app_get_current_pixel_format()); if (m_hotIndex == i) hotBounds = box; } if (!hotBounds.isEmpty() && isHotEntryVisible()) { hotBounds.enlarge(3*ui::guiscale()); ui::PaintWidgetPartInfo info; theme->paintWidgetPart( g, theme->styles.shadeSelection(), hotBounds, info); } } else { g->fillRect(theme->colors.editorFace(), bounds); g->drawAlignedUIText(text(), theme->colors.face(), gfx::ColorNone, bounds, ui::CENTER | ui::MIDDLE); } }
void StatusBar::onPaint(ui::PaintEvent& ev) { SkinTheme* theme = static_cast<SkinTheme*>(this->getTheme()); ui::Color textColor = theme->getColorById(kStatusBarText); Rect rc = getClientBounds(); Graphics* g = ev.getGraphics(); g->fillRect(getBgColor(), rc); rc.shrink(Border(2, 1, 2, 2)*jguiscale()); int x = rc.x + 4*jguiscale(); // Color if (m_state == SHOW_COLOR) { // Draw eyedropper icon BITMAP* icon = theme->get_toolicon("eyedropper"); if (icon) { g->drawAlphaBitmap(icon, x, rc.y + rc.h/2 - icon->h/2); x += icon->w + 4*jguiscale(); } // Draw color draw_color_button(g, gfx::Rect(x, rc.y, 32*jguiscale(), rc.h), true, true, true, true, true, true, true, true, app_get_current_pixel_format(), m_color, false, false); x += (32+4)*jguiscale(); // Draw color description std::string str = m_color.toHumanReadableString(app_get_current_pixel_format(), app::Color::LongHumanReadableString); if (m_alpha < 255) { char buf[512]; usprintf(buf, ", Alpha %d", m_alpha); str += buf; } g->drawString(str, textColor, ColorNone, false, gfx::Point(x, rc.y + rc.h/2 - text_height(getFont())/2)); x += ji_font_text_len(getFont(), str.c_str()) + 4*jguiscale(); } // Show tool if (m_state == SHOW_TOOL) { // Draw eyedropper icon BITMAP* icon = theme->get_toolicon(m_tool->getId().c_str()); if (icon) { g->drawAlphaBitmap(icon, x, rc.y + rc.h/2 - icon->h/2); x += icon->w + 4*jguiscale(); } } // Status bar text if (getTextLength() > 0) { g->drawString(getText(), textColor, ColorNone, false, gfx::Point(x, rc.y + rc.h/2 - text_height(getFont())/2)); x += ji_font_text_len(getFont(), getText().c_str()) + 4*jguiscale(); } // Draw progress bar if (!m_progress.empty()) { int width = 64; int x = rc.x2() - (width+4); for (ProgressList::iterator it = m_progress.begin(); it != m_progress.end(); ++it) { Progress* progress = *it; theme->paintProgressBar(g, gfx::Rect(x, rc.y, width, rc.h), progress->getPos()); x -= width+4; } } updateSubwidgetsVisibility(); }
void ButtonSet::Item::onPaint(ui::PaintEvent& ev) { SkinTheme* theme = static_cast<SkinTheme*>(getTheme()); Graphics* g = ev.getGraphics(); gfx::Rect rc = getClientBounds(); gfx::Color fg, bg; SkinPartPtr nw; gfx::Rect boxRc, textRc, iconRc; gfx::Size iconSize; if (m_icon) iconSize = m_icon->getSize(); getTextIconInfo( &boxRc, &textRc, &iconRc, CENTER | (hasText() ? BOTTOM: MIDDLE), iconSize.w, iconSize.h); Grid::Info info = buttonSet()->getChildInfo(this); bool isLastCol = (info.col+info.hspan >= info.grid_cols); bool isLastRow = (info.row+info.vspan >= info.grid_rows); if (m_icon || isLastRow) { textRc.y -= 1*guiscale(); iconRc.y -= 1*guiscale(); } if (!gfx::is_transparent(getBgColor())) g->fillRect(getBgColor(), g->getClipBounds()); if (isSelected() || hasMouseOver()) { if (hasCapture()) { nw = theme->parts.toolbuttonPushed(); fg = theme->colors.buttonSelectedText(); bg = theme->colors.buttonSelectedFace(); } else { nw = (hasFocus() ? theme->parts.toolbuttonHotFocused(): theme->parts.toolbuttonHot()); fg = theme->colors.buttonHotText(); bg = theme->colors.buttonHotFace(); } } else { nw = (hasFocus() ? theme->parts.toolbuttonFocused(): theme->parts.toolbuttonLast()); fg = theme->colors.buttonNormalText(); bg = theme->colors.buttonNormalFace(); } if (!isLastCol) rc.w += 1*guiscale(); if (!isLastRow) { if (nw == theme->parts.toolbuttonHotFocused()) rc.h += 2*guiscale(); else rc.h += 3*guiscale(); } theme->drawRect(g, rc, nw.get(), bg); if (m_icon) { if (isSelected() && hasCapture()) g->drawColoredRgbaSurface(m_icon->getBitmap(0), theme->colors.buttonSelectedText(), iconRc.x, iconRc.y); else g->drawRgbaSurface(m_icon->getBitmap(0), iconRc.x, iconRc.y); } if (hasText()) { g->setFont(getFont()); g->drawUIString(getText(), fg, gfx::ColorNone, textRc.getOrigin(), false); } }
void ColorTintShadeTone::onPaint(ui::PaintEvent& ev) { ui::Graphics* g = ev.graphics(); SkinTheme* theme = static_cast<SkinTheme*>(this->theme()); theme->drawRect(g, clientBounds(), theme->parts.editorNormal().get(), bgColor()); gfx::Rect rc = clientChildrenBounds(); if (rc.isEmpty()) return; double hue = m_color.getHue(); int umax, vmax; int huebar = getHueBarSize(); umax = MAX(1, rc.w-1); vmax = MAX(1, rc.h-1-huebar); for (int y=0; y<rc.h-huebar; ++y) { for (int x=0; x<rc.w; ++x) { double sat = (100.0 * x / umax); double val = (100.0 - 100.0 * y / vmax); gfx::Color color = color_utils::color_for_ui( app::Color::fromHsv( hue, MID(0.0, sat, 100.0), MID(0.0, val, 100.0))); g->putPixel(color, rc.x+x, rc.y+y); } } if (huebar > 0) { for (int y=rc.h-huebar; y<rc.h; ++y) { for (int x=0; x<rc.w; ++x) { gfx::Color color = color_utils::color_for_ui( app::Color::fromHsv( (360.0 * x / rc.w), 100.0, 100.0)); g->putPixel(color, rc.x+x, rc.y+y); } } } if (m_color.getType() != app::Color::MaskType) { double sat = m_color.getSaturation(); double val = m_color.getValue(); gfx::Point pos(rc.x + int(sat * rc.w / 100.0), rc.y + int((100.0-val) * (rc.h-huebar) / 100.0)); she::Surface* icon = theme->parts.colorWheelIndicator()->bitmap(0); g->drawColoredRgbaSurface( icon, val > 50.0 ? gfx::rgba(0, 0, 0): gfx::rgba(255, 255, 255), pos.x-icon->width()/2, pos.y-icon->height()/2); if (huebar > 0) { pos.x = rc.x + int(rc.w * hue / 360.0); pos.y = rc.y + rc.h - huebar/2; g->drawColoredRgbaSurface( icon, gfx::rgba(0, 0, 0), pos.x-icon->width()/2, pos.y-icon->height()/2); } } }
void FileList::onPaint(ui::PaintEvent& ev) { Graphics* g = ev.getGraphics(); SkinTheme* theme = static_cast<SkinTheme*>(getTheme()); View* view = View::getView(this); gfx::Rect vp = view->getViewportBounds(); gfx::Rect bounds = getClientBounds(); int x, y = bounds.y; int evenRow = 0; gfx::Color bgcolor; gfx::Color fgcolor; she::Surface* thumbnail = NULL; int thumbnail_y = 0; g->fillRect(theme->getColor(ThemeColor::Background), bounds); // rows for (FileItemList::iterator it=m_list.begin(), end=m_list.end(); it!=end; ++it) { IFileItem* fi = *it; gfx::Size itemSize = getFileItemSize(fi); if (fi == m_selected) { fgcolor = theme->getColor(ThemeColor::FileListSelectedRowText); bgcolor = theme->getColor(ThemeColor::FileListSelectedRowFace); } else { bgcolor = evenRow ? theme->getColor(ThemeColor::FileListEvenRowFace): theme->getColor(ThemeColor::FileListOddRowFace); if (fi->isFolder() && !fi->isBrowsable()) fgcolor = theme->getColor(ThemeColor::FileListDisabledRowText); else fgcolor = evenRow ? theme->getColor(ThemeColor::FileListEvenRowText): theme->getColor(ThemeColor::FileListOddRowText); } x = bounds.x+2*jguiscale(); // Item background g->fillRect(bgcolor, gfx::Rect(bounds.x, y, bounds.w, itemSize.h)); if (fi->isFolder()) { int icon_w = getFont()->textLength("[+]"); g->drawUIString("[+]", fgcolor, bgcolor, gfx::Point(x, y+2*jguiscale())); x += icon_w+2*jguiscale(); } // item name g->drawString( fi->getDisplayName().c_str(), fgcolor, bgcolor, gfx::Point(x, y+2*jguiscale())); // draw progress bars double progress; ThumbnailGenerator::WorkerStatus workerStatus = ThumbnailGenerator::instance()->getWorkerStatus(fi, progress); if (workerStatus == ThumbnailGenerator::WorkingOnThumbnail) { int barw = 64*jguiscale(); theme->paintProgressBar(g, gfx::Rect( bounds.x2()-2*jguiscale()-barw, y+itemSize.h/2-3*jguiscale(), barw, 6*jguiscale()), progress); } // Thumbnail position if (fi == m_selected) { thumbnail = fi->getThumbnail(); if (thumbnail) thumbnail_y = y + itemSize.h/2; } y += itemSize.h; evenRow ^= 1; } // Draw the thumbnail if (thumbnail) { x = vp.x+vp.w - 2*jguiscale() - thumbnail->width(); y = thumbnail_y - thumbnail->height()/2 + getBounds().y; y = MID(vp.y+2*jguiscale(), y, vp.y+vp.h-3*jguiscale()-thumbnail->height()); x -= getBounds().x; y -= getBounds().y; g->blit(thumbnail, 0, 0, x, y, thumbnail->width(), thumbnail->height()); g->drawRect(gfx::rgba(0, 0, 0), gfx::Rect(x-1, y-1, thumbnail->width()+1, thumbnail->height()+1)); } }