(Graphics g)
| 139 | } |
| 140 | |
| 141 | @Override |
| 142 | public void draw(Graphics g) { |
| 143 | float x, y, w, h; |
| 144 | |
| 145 | FSkinColor foreColor; |
| 146 | if (dropDown.isVisible()) { |
| 147 | x = PADDING; //round so lines show up reliably |
| 148 | y = PADDING; |
| 149 | w = getWidth() - 2 * x + 1; |
| 150 | h = getHeight() - y + 1; |
| 151 | |
| 152 | g.startClip(x, y, w, h); |
| 153 | g.fillRect(getSelBackColor(), x, y, w, h); |
| 154 | g.drawRect(2, getSelBorderColor(), x, y, w, h); |
| 155 | g.endClip(); |
| 156 | |
| 157 | foreColor = getSelForeColor(); |
| 158 | } |
| 159 | else { |
| 160 | foreColor = getForeColor(); |
| 161 | } |
| 162 | |
| 163 | //draw right separator |
| 164 | if (index < menuBar.getTabCount() - 1) { |
| 165 | x = getWidth(); |
| 166 | y = getHeight() / 4; |
| 167 | g.drawLine(SEPARATOR_WIDTH, getSeparatorColor(), x, y, x, getHeight() - y); |
| 168 | } |
| 169 | |
| 170 | x = PADDING; |
| 171 | y = PADDING; |
| 172 | w = getWidth() - 2 * PADDING; |
| 173 | h = getHeight() - 2 * PADDING; |
| 174 | if (isHovered()) |
| 175 | g.fillRect(getSelBackColor().brighter(), x, y, w, h); |
| 176 | |
| 177 | //flash overlay while a recent unread message highlights the tab |
| 178 | if (flashStartMs > 0) { |
| 179 | long elapsed = System.currentTimeMillis() - flashStartMs; |
| 180 | if (elapsed < FLASH_DURATION_MS) { |
| 181 | float alpha = 0.55f * (1f - (float) elapsed / FLASH_DURATION_MS); |
| 182 | g.fillRect(BADGE_COLOR.alphaColor(alpha), x, y, w, h); |
| 183 | Gdx.graphics.requestRendering(); |
| 184 | } else { |
| 185 | flashStartMs = 0; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | if (iconOnly) { |
| 190 | float mod = w * 0.75f; |
| 191 | FImage icon = active ? FSkinImage.SEE : FSkinImage.UNSEE; |
| 192 | float scaleW = w * 0.8f; |
| 193 | float scaleH = scaleW * 0.6f; |
| 194 | g.drawImage(icon, x + w/2 - scaleW/2, y + h/2 - scaleH/2, scaleW, scaleH); |
| 195 | } else |
| 196 | g.drawText(text, FONT, foreColor, x, y, w, h, false, Align.center, true); |
| 197 | |
| 198 | //unread badge in the top-right corner |
nothing calls this directly
no test coverage detected