Add: TabLayout

This commit is contained in:
2019-07-26 12:00:23 +09:00
parent 995dcffc88
commit 9c26aa2a71
7 changed files with 230 additions and 67 deletions
+53 -11
View File
@@ -2,8 +2,41 @@ AppGroupTab.prototype = Object.create(BasicTab.prototype);
AppGroupTab.constructor = AppGroupTab;
function AppGroupTab(clickEvent) {
var setting = new TabSetting(150, MainMenu.MAIN_MENU_HEIGHT / 2, 140, MainMenu.MAIN_MENU_HEIGHT);
setting.setFont("Nanum Gothic");
BasicTab.call(this);
this.reservedClickEvent = clickEvent;
this.tabLayout = null;
this.reservedMainText = "";
this.reservedShortcutText = "";
this.reservedIconName = "";
}
AppGroupTab.prototype.setTabLayout = function(tabLayout) {
this.tabLayout = tabLayout;
}
AppGroupTab.prototype.reserveMainText = function(text) {
this.reservedMainText = text;
}
AppGroupTab.prototype.reserveIcon = function(iconName) {
this.reservedIconName = iconName;
}
AppGroupTab.prototype.reserveShortcutText = function(text) {
this.reservedShortcutText = text;
}
AppGroupTab.prototype.createTab = function(index) {
var width = this.tabLayout.getTabWidth();
var height = this.tabLayout.getTabHeight();
var x = this.tabLayout.getX() + width / 2 + width * index;
var y = this.tabLayout.getY() + height / 2;
var setting = new TabSetting(x, y, width, height);
setting.setFont("Nanum Pen Script");
setting.setFontSize(20);
setting.setButtonColor(
AppGroupTab.BUTTON_COLOR_OUT_HEX,
@@ -31,23 +64,32 @@ function AppGroupTab(clickEvent) {
);
BasicTab.call(this, setting, clickEvent);
this.createButton(
setting,
(function() {
this.tabLayout.selectedTab(this);
this.reservedClickEvent();
}).bind(this)
);
// this.setMainTextFontWeight("bold");
this.setMainText("마우스 MOU");
this.setMainTextFontWeight("800");
// this.addIcon("home");
// this.setIconSize(30);
this.setShortcutText("MOUSE");
if(this.reservedMainText.length > 0)
this.setMainText(this.reservedMainText);
if(this.reservedIconName.length > 0)
this.addIcon(this.reservedIconName);
if(this.reservedShortcutText.length > 0)
this.setShortcutText(this.reservedShortcutText);
}
AppGroupTab.STROKE_COLOR_OUT_HEX = 0xAA6666;
AppGroupTab.STROKE_COLOR_OUT_HEX = 0xAA6666;
AppGroupTab.STROKE_COLOR_OVER_HEX = 0x884444;
AppGroupTab.STROKE_COLOR_DOWN_HEX = 0x884444;
AppGroupTab.STROKE_COLOR_DISABLED_HEX = 0x333333;
AppGroupTab.BUTTON_COLOR_OUT_HEX = 0xffdddd;
AppGroupTab.BUTTON_COLOR_OUT_HEX = 0xffdddd;
AppGroupTab.BUTTON_COLOR_OVER_HEX = 0xddaaaa;
AppGroupTab.BUTTON_COLOR_DOWN_HEX = 0xddaaaa;
AppGroupTab.BUTTON_COLOR_DISABLED_HEX = 0x666666;