Browse Source
Merge in DESIGN/design from ~STARRYI/design:release/11.0 to release/11.0 * commit '022b4af184e8d8293551b011a9fff4c3ff904d94': REPORT-61108 【视觉验收】--主题获取 REPORT-61116 【主题切换】多选单元格,格子从跟随主题切换到自定义,内边框不可设置bugfix/11.0
starryi
3 years ago
11 changed files with 138 additions and 18 deletions
@ -0,0 +1,44 @@
|
||||
package com.fr.design.mainframe.share.ui.actions; |
||||
|
||||
import com.fr.design.constants.UIConstants; |
||||
import com.fr.design.gui.imenu.UIMenuItemUI; |
||||
import com.fr.design.utils.gui.GUIPaintUtils; |
||||
import com.fr.stable.Constants; |
||||
|
||||
import javax.swing.ButtonModel; |
||||
import javax.swing.JMenu; |
||||
import javax.swing.JMenuItem; |
||||
import javax.swing.JPopupMenu; |
||||
import java.awt.Color; |
||||
import java.awt.Graphics; |
||||
import java.awt.Graphics2D; |
||||
|
||||
/** |
||||
* @author Starryi |
||||
* @version 1.0 |
||||
* Created by Starryi on 2021/10/18 |
||||
*/ |
||||
public class SharedComponentActionMenuItemUI extends UIMenuItemUI { |
||||
|
||||
@Override |
||||
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { |
||||
ButtonModel model = menuItem.getModel(); |
||||
Color oldColor = g.getColor(); |
||||
int menuWidth = menuItem.getWidth(); |
||||
int menuHeight = menuItem.getHeight(); |
||||
|
||||
g.setColor(UIConstants.NORMAL_BACKGROUND); |
||||
g.fillRect(0, 0, menuWidth, menuHeight); |
||||
if (menuItem.isOpaque()) { |
||||
if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); |
||||
} else { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); |
||||
} |
||||
g.setColor(oldColor); |
||||
} else if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); |
||||
g.setColor(oldColor); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
package com.fr.design.mainframe.share.ui.constants; |
||||
|
||||
import java.awt.Color; |
||||
|
||||
/** |
||||
* @author Starryi |
||||
* @version 1.0 |
||||
* Created by Starryi on 2021/10/19 |
||||
*/ |
||||
public class ColorConstants { |
||||
public static final Color BACKGROUND = new Color(0xF0F0F1); |
||||
} |
Loading…
Reference in new issue