mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Ui themes support (#2700)
* settings ui_theme * theme css rendering * theme split * linetr fix
This commit is contained in:
parent
f9f8adcf9e
commit
6845fe3ea4
File diff suppressed because it is too large
Load Diff
339
src/ui/zabapgit_css_theme_default.w3mi.data.css
Normal file
339
src/ui/zabapgit_css_theme_default.w3mi.data.css
Normal file
|
@ -0,0 +1,339 @@
|
|||
/*
|
||||
* ABAPGIT COLOR THEME CSS - DEFAULT
|
||||
*/
|
||||
|
||||
/* GLOBALS */
|
||||
body { background-color: #E8E8E8; }
|
||||
a, a:visited { color: #4078c0; }
|
||||
input, textarea, select { border-color: #ddd; }
|
||||
input:focus, textarea:focus { border-color: #8cadd9; }
|
||||
|
||||
/* COLOR PALETTE */
|
||||
.grey { color: lightgrey !important; }
|
||||
.grey70 { color: #b3b3b3 !important; }
|
||||
.grey80 { color: #ccc !important; }
|
||||
.bgorange { background-color: orange; }
|
||||
.darkgrey { color: #808080 !important; }
|
||||
.attention { color: red !important; }
|
||||
.error { color: #d41919 !important; }
|
||||
.warning { color: #efb301 !important; }
|
||||
.success { color: green !important; }
|
||||
.blue { color: #5e8dc9 !important; }
|
||||
.red { color: red !important; }
|
||||
.white { color: white !important; }
|
||||
|
||||
/* Floating buttons and color sets */
|
||||
.blue-set {
|
||||
border-color: #abc3e3;
|
||||
color: #5e8dc9;
|
||||
background-color: #d9e4f2;
|
||||
}
|
||||
.grey-set {
|
||||
border-color: #c7c7c7;
|
||||
color: #808080;
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
|
||||
/* PANELS */
|
||||
/* TODO: add warning and error colors */
|
||||
div.panel.success {
|
||||
color: #589a58 !important;
|
||||
background-color: #c5eac5;
|
||||
}
|
||||
#debug-output { color: #ccc; }
|
||||
div.dummydiv { background-color: #f2f2f2; }
|
||||
|
||||
/* STRUCTURE DIVS, HEADER & FOOTER */
|
||||
div#header { border-bottom-color: lightgrey; }
|
||||
div#header span.page_title { color: #bbb; }
|
||||
div#toc { background-color: #f2f2f2; }
|
||||
div#footer span.version { color: grey; }
|
||||
div#footer { border-top-color: lightgrey; }
|
||||
|
||||
/* ERROR LOG */
|
||||
div.log {
|
||||
background-color: #fee6e6;
|
||||
border-color: #fdcece;
|
||||
}
|
||||
|
||||
/* REPOSITORY */
|
||||
div.repo { background-color: #f2f2f2; }
|
||||
.repo_name span.name { color: #333; }
|
||||
.repo_name span.url { color: #ccc; }
|
||||
.repo_name a.url { color: #ccc; }
|
||||
.repo_attr { color: grey; }
|
||||
|
||||
.repo_attr span.bg_marker {
|
||||
border-color: #d2d2d2;
|
||||
background-color: #d8d8d8;
|
||||
color: #fff;
|
||||
}
|
||||
.repo_attr span.branch {
|
||||
border-color: #d9d9d9;
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
.repo_attr span.branch_head {
|
||||
border-color: #d8dff3;
|
||||
background-color: #eceff9;
|
||||
}
|
||||
.repo_attr span.branch_branch {
|
||||
border-color: #e7d9b1;
|
||||
background-color: #f8f0d8;
|
||||
}
|
||||
|
||||
/* REPOSITORY TABLE*/
|
||||
table.repo_tab {
|
||||
border-color: #ddd;
|
||||
background-color: #fff;
|
||||
}
|
||||
.repo_tab td {
|
||||
color: #333;
|
||||
border-top-color: #eee;
|
||||
}
|
||||
.repo_tab .inactive { color: orange; }
|
||||
.repo_tab tr.unsupported { color: lightgrey; }
|
||||
.repo_tab tr.modified { background-color: #fbf7e9; }
|
||||
.repo_tab td.current_dir { color: #ccc; }
|
||||
.repo_tab td.cmd span.state-block span { border-color: #000; }
|
||||
|
||||
.repo_tab td.cmd span.state-block span.added {
|
||||
background-color: #69ad74;
|
||||
border-color: #579e64;
|
||||
color: white;
|
||||
}
|
||||
.repo_tab td.cmd span.state-block span.changed {
|
||||
background-color: #e0c150;
|
||||
border-color: #d4af25;
|
||||
color: white;
|
||||
}
|
||||
.repo_tab td.cmd span.state-block span.mixed {
|
||||
background-color: #e0c150;
|
||||
border-color: #579e64;
|
||||
color: #69ad74;
|
||||
}
|
||||
.repo_tab td.cmd span.state-block span.deleted {
|
||||
background-color: #c76861;
|
||||
border-color: #b8605a;
|
||||
color: white;
|
||||
}
|
||||
.repo_tab td.cmd span.state-block span.none {
|
||||
background-color: #e8e8e8;
|
||||
border-color: #dbdbdb;
|
||||
color: #c8c8c8;
|
||||
}
|
||||
|
||||
/* STAGE */
|
||||
.stage_tab {
|
||||
border-color: #ddd;
|
||||
background-color: #fff;
|
||||
}
|
||||
.stage_tab td {
|
||||
color: #333;
|
||||
border-top-color: #eee;
|
||||
}
|
||||
.stage_tab th {
|
||||
color: #bbb;
|
||||
background-color: #edf2f9;
|
||||
}
|
||||
.stage_tab td.status {
|
||||
color: #ccc;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
.stage_tab td.highlight { color: #444 !important; }
|
||||
.stage_tab td.method { color: #ccc; }
|
||||
.stage_tab td.user { color: #aaa; }
|
||||
.stage_tab td.type { color: #aaa; }
|
||||
.stage_tab mark {
|
||||
color: white;
|
||||
background-color: #79a0d2;
|
||||
}
|
||||
|
||||
/* COMMIT */
|
||||
div.form-container { background-color: #F8F8F8; }
|
||||
form.aligned-form label { color: #bbb; }
|
||||
form.aligned-form span.sub-title { color: #bbb; }
|
||||
|
||||
/* SETTINGS STYLES */
|
||||
div.settings_container {
|
||||
color: #444;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
/* DIFF */
|
||||
div.diff { background-color: #f2f2f2; }
|
||||
span.diff_name { color: grey; }
|
||||
span.diff_name strong { color: #333; }
|
||||
span.diff_changed_by { color: grey; }
|
||||
span.diff_changed_by span.user {
|
||||
border-color: #c2d4ea;
|
||||
background-color: #d9e4f2;
|
||||
}
|
||||
.diff_ins {
|
||||
border-color: #abf2ab;
|
||||
background-color: #e0ffe0;
|
||||
}
|
||||
.diff_del {
|
||||
border-color: #ff667d;
|
||||
background-color: #ffccd4;
|
||||
}
|
||||
.diff_upd {
|
||||
border-color: #dada00;
|
||||
background-color: #ffffcc;
|
||||
}
|
||||
div.diff_content {
|
||||
background-color: #fff;
|
||||
border-top-color: #ddd;
|
||||
border-bottom-color: #ddd;
|
||||
}
|
||||
div.diff_head span.state-block span {
|
||||
border-color: #000;
|
||||
}
|
||||
div.diff_head span.state-block span.added {
|
||||
background-color: #69ad74;
|
||||
border-color: #579e64;
|
||||
color: white;
|
||||
}
|
||||
div.diff_head span.state-block span.changed {
|
||||
background-color: #e0c150;
|
||||
border-color: #d4af25;
|
||||
color: white;
|
||||
}
|
||||
div.diff_head span.state-block span.mixed {
|
||||
background-color: #e0c150;
|
||||
border-color: #579e64;
|
||||
color: #69ad74;
|
||||
}
|
||||
div.diff_head span.state-block span.deleted {
|
||||
background-color: #c76861;
|
||||
border-color: #b8605a;
|
||||
color: white;
|
||||
}
|
||||
div.diff_head span.state-block span.none {
|
||||
background-color: #e8e8e8;
|
||||
border-color: #dbdbdb;
|
||||
color: #c8c8c8;
|
||||
}
|
||||
|
||||
/* DIFF TABLE */
|
||||
table.diff_tab td,th {
|
||||
color: #444;
|
||||
}
|
||||
table.diff_tab thead.header th {
|
||||
color: #eee;
|
||||
background-color: #bbb;
|
||||
}
|
||||
table.diff_tab thead.nav_line {
|
||||
background-color: #edf2f9;
|
||||
}
|
||||
table.diff_tab thead.nav_line th {
|
||||
color: #bbb;
|
||||
}
|
||||
table.diff_tab td.num, th.num {
|
||||
color: #ccc;
|
||||
border-left-color: #eee;
|
||||
border-right-color: #eee;
|
||||
}
|
||||
table.diff_tab td.patch, th.patch {
|
||||
color: #ccc;
|
||||
border-left-color: #eee;
|
||||
border-right-color: #eee;
|
||||
}
|
||||
|
||||
/* STYLES for Syntax Highlighting */
|
||||
.syntax-hl span.keyword { color: #0a69ce; }
|
||||
.syntax-hl span.text { color: #48ce4f; }
|
||||
.syntax-hl span.comment { color: #808080; font-style: italic; }
|
||||
.syntax-hl span.xml_tag { color: #457ce3; }
|
||||
.syntax-hl span.attr { color: #b777fb; }
|
||||
.syntax-hl span.attr_val { color: #7a02f9; }
|
||||
|
||||
/* DEBUG INFO STYLES */
|
||||
div.debug_container { color: #444; }
|
||||
|
||||
/* DB ENTRIES */
|
||||
div.db_list { background-color: #fff; }
|
||||
table.db_tab td { color: #333; }
|
||||
table.db_tab td.data { color: #888; }
|
||||
table.db_tab tbody tr:hover, tr:active { background-color: #f4f4f4; }
|
||||
table.db_tab th {
|
||||
color: #888888;
|
||||
border-bottom-color: #ddd;
|
||||
}
|
||||
|
||||
/* DB ENTRY DISPLAY */
|
||||
div.db_entry {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
div.db_entry pre {
|
||||
background-color: #fcfcfc;
|
||||
border-color: #eaeaea;
|
||||
}
|
||||
table.tag {
|
||||
border-color: #b3c1cc;
|
||||
background-color: #eee;
|
||||
}
|
||||
table.tag td.label { background-color: #b3c1cc; }
|
||||
|
||||
/* TUTORIAL */
|
||||
div.tutorial { background-color: #f2f2f2; }
|
||||
div.tutorial hr { border-color: #ccc; }
|
||||
div.tutorial h1, h2 { color: #404040; }
|
||||
|
||||
/* MENU */
|
||||
.nav-container ul ul li:hover { background-color: #f6f6f6; }
|
||||
.nav-container > ul > li:hover > a { background-color: #ffffff80; }
|
||||
.nav-container ul ul { background-color: #fff; }
|
||||
.nav-container.corner > ul > li:hover > a { background-color: inherit; }
|
||||
|
||||
/* Toolbar separator style */
|
||||
.nav-container ul ul li.separator {
|
||||
color: #bbb;
|
||||
border-bottom-color: #eee;
|
||||
border-top-color: #eee;
|
||||
}
|
||||
.nav-container ul ul li.separator:hover { background-color: inherit; }
|
||||
|
||||
/* News Announcement */
|
||||
div.info-panel { background-color: white; }
|
||||
div.info-panel div.info-hint { color: #ccc; }
|
||||
div.info-panel div.info-title {
|
||||
color: #f8f8f8;
|
||||
background-color: #888;
|
||||
}
|
||||
div.info-panel div.info-title a.close-btn { color: #d8d8d8; }
|
||||
div.info-panel div.info-list { color: #444; }
|
||||
div.info-panel .version-marker {
|
||||
color: white;
|
||||
border-color: #c0c0c0;
|
||||
background-color: #ccc;
|
||||
}
|
||||
div.info-panel .update {
|
||||
border-color: #e8ba30;
|
||||
background-color: #f5c538;
|
||||
}
|
||||
|
||||
/* Tooltips text */
|
||||
.tooltiptext { color: #000; }
|
||||
/* Tooltip arrow */
|
||||
.tooltiptext::after { border-color: #555 transparent transparent transparent; }
|
||||
|
||||
/* HOTKEYS */
|
||||
ul.hotkeys span.key-id {
|
||||
background-color: #f0f0f0;
|
||||
border-color: #dcdcdc;
|
||||
}
|
||||
div.corner-hint {
|
||||
color: #aaa;
|
||||
border-color: #ccc;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* code inspector */
|
||||
.ci-head { background-color: #f2f2f2; }
|
||||
.ci-head .package-name span { color: grey; }
|
||||
.ci-variant { color: #444; }
|
||||
.ci-result { background-color: #f6f6f6; }
|
||||
.ci-result li { color: #444; }
|
||||
.ci-result li.ci-error { border-left-color: #cd5353; }
|
||||
.ci-result li.ci-warning { border-left-color: #ecd227; }
|
||||
.ci-result li.ci-info { border-left-color: #acacac; }
|
29
src/ui/zabapgit_css_theme_default.w3mi.xml
Normal file
29
src/ui/zabapgit_css_theme_default.w3mi.xml
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_W3MI" serializer_version="v2.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<NAME>ZABAPGIT_CSS_THEME_DEFAULT</NAME>
|
||||
<TEXT>abapGit default color theme</TEXT>
|
||||
<PARAMS>
|
||||
<WWWPARAMS>
|
||||
<RELID>MI</RELID>
|
||||
<OBJID>ZABAPGIT_CSS_THEME_DEFAULT</OBJID>
|
||||
<NAME>fileextension</NAME>
|
||||
<VALUE>.CSS</VALUE>
|
||||
</WWWPARAMS>
|
||||
<WWWPARAMS>
|
||||
<RELID>MI</RELID>
|
||||
<OBJID>ZABAPGIT_CSS_THEME_DEFAULT</OBJID>
|
||||
<NAME>filename</NAME>
|
||||
<VALUE>THEME-default.CSS</VALUE>
|
||||
</WWWPARAMS>
|
||||
<WWWPARAMS>
|
||||
<RELID>MI</RELID>
|
||||
<OBJID>ZABAPGIT_CSS_THEME_DEFAULT</OBJID>
|
||||
<NAME>mimetype</NAME>
|
||||
<VALUE>text/css</VALUE>
|
||||
</WWWPARAMS>
|
||||
</PARAMS>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -87,32 +87,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD insert_hotkeys_to_page.
|
||||
|
||||
DATA: lv_json TYPE string.
|
||||
|
||||
FIELD-SYMBOLS: <ls_hotkey> LIKE LINE OF mt_hotkeys.
|
||||
|
||||
lv_json = `{`.
|
||||
|
||||
LOOP AT mt_hotkeys ASSIGNING <ls_hotkey>.
|
||||
|
||||
IF sy-tabix > 1.
|
||||
lv_json = lv_json && |,|.
|
||||
ENDIF.
|
||||
|
||||
lv_json = lv_json && | "{ <ls_hotkey>-hotkey }" : "{ <ls_hotkey>-action }" |.
|
||||
|
||||
ENDLOOP.
|
||||
|
||||
lv_json = lv_json && `}`.
|
||||
|
||||
io_html->add( |setKeyBindings({ lv_json });| ).
|
||||
|
||||
ENDMETHOD.
|
||||
CLASS ZCL_ABAPGIT_GUI_PAGE IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD call_browser.
|
||||
|
@ -146,6 +121,37 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD define_hotkeys.
|
||||
|
||||
DATA: lo_settings TYPE REF TO zcl_abapgit_settings,
|
||||
lt_user_defined_hotkeys TYPE zif_abapgit_definitions=>tty_hotkey.
|
||||
|
||||
FIELD-SYMBOLS: <ls_hotkey> TYPE zif_abapgit_gui_page_hotkey=>ty_hotkey_with_name,
|
||||
<ls_user_defined_hotkey> LIKE LINE OF lt_user_defined_hotkeys.
|
||||
|
||||
rt_hotkeys = get_default_hotkeys( ).
|
||||
|
||||
" Override default hotkeys with user defined
|
||||
lo_settings = zcl_abapgit_persist_settings=>get_instance( )->read( ).
|
||||
lt_user_defined_hotkeys = lo_settings->get_hotkeys( ).
|
||||
|
||||
LOOP AT rt_hotkeys ASSIGNING <ls_hotkey>.
|
||||
|
||||
READ TABLE lt_user_defined_hotkeys ASSIGNING <ls_user_defined_hotkey>
|
||||
WITH TABLE KEY action
|
||||
COMPONENTS action = <ls_hotkey>-action.
|
||||
IF sy-subrc = 0.
|
||||
<ls_hotkey>-hotkey = <ls_user_defined_hotkey>-hotkey.
|
||||
ELSEIF lines( lt_user_defined_hotkeys ) > 0.
|
||||
" User removed the hotkey
|
||||
DELETE TABLE rt_hotkeys FROM <ls_hotkey>.
|
||||
ENDIF.
|
||||
|
||||
ENDLOOP.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD footer.
|
||||
|
||||
CREATE OBJECT ro_html.
|
||||
|
@ -165,6 +171,26 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_default_hotkeys.
|
||||
|
||||
DATA: lt_page_hotkeys LIKE mt_hotkeys.
|
||||
|
||||
rt_default_hotkeys = get_global_hotkeys( ).
|
||||
|
||||
TRY.
|
||||
CALL METHOD me->('ZIF_ABAPGIT_GUI_PAGE_HOTKEY~GET_HOTKEY_ACTIONS')
|
||||
RECEIVING
|
||||
rt_hotkey_actions = lt_page_hotkeys.
|
||||
|
||||
INSERT LINES OF lt_page_hotkeys INTO TABLE rt_default_hotkeys.
|
||||
|
||||
CATCH cx_root.
|
||||
" Current page doesn't implement hotkey interface, do nothing
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_global_hotkeys.
|
||||
|
||||
" these are the global shortcuts active on all pages
|
||||
|
@ -190,6 +216,16 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
|||
|
||||
ro_html->add( '<title>abapGit</title>' ). "#EC NOTEXT
|
||||
ro_html->add( '<link rel="stylesheet" type="text/css" href="css/common.css">' ).
|
||||
|
||||
CASE mo_settings->get_ui_theme( ).
|
||||
WHEN zcl_abapgit_settings=>c_ui_theme-dark.
|
||||
ro_html->add( '<link rel="stylesheet" type="text/css" href="css/theme-default.css">' ). "TODO
|
||||
WHEN zcl_abapgit_settings=>c_ui_theme-belize.
|
||||
ro_html->add( '<link rel="stylesheet" type="text/css" href="css/theme-default.css">' ). "TODO
|
||||
WHEN OTHERS.
|
||||
ro_html->add( '<link rel="stylesheet" type="text/css" href="css/theme-default.css">' ).
|
||||
ENDCASE.
|
||||
|
||||
ro_html->add( '<link rel="stylesheet" type="text/css" href="css/ag-icons.css">' ).
|
||||
ro_html->add( '<script type="text/javascript" src="js/common.js"></script>' ). "#EC NOTEXT
|
||||
|
||||
|
@ -205,6 +241,31 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD insert_hotkeys_to_page.
|
||||
|
||||
DATA: lv_json TYPE string.
|
||||
|
||||
FIELD-SYMBOLS: <ls_hotkey> LIKE LINE OF mt_hotkeys.
|
||||
|
||||
lv_json = `{`.
|
||||
|
||||
LOOP AT mt_hotkeys ASSIGNING <ls_hotkey>.
|
||||
|
||||
IF sy-tabix > 1.
|
||||
lv_json = lv_json && |,|.
|
||||
ENDIF.
|
||||
|
||||
lv_json = lv_json && | "{ <ls_hotkey>-hotkey }" : "{ <ls_hotkey>-action }" |.
|
||||
|
||||
ENDLOOP.
|
||||
|
||||
lv_json = lv_json && `}`.
|
||||
|
||||
io_html->add( |setKeyBindings({ lv_json });| ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD link_hints.
|
||||
|
||||
DATA: lv_link_hint_key TYPE char01,
|
||||
|
@ -340,56 +401,4 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
|||
ro_html->add( '</html>' ). "#EC NOTEXT
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD define_hotkeys.
|
||||
|
||||
DATA: lo_settings TYPE REF TO zcl_abapgit_settings,
|
||||
lt_user_defined_hotkeys TYPE zif_abapgit_definitions=>tty_hotkey.
|
||||
|
||||
FIELD-SYMBOLS: <ls_hotkey> TYPE zif_abapgit_gui_page_hotkey=>ty_hotkey_with_name,
|
||||
<ls_user_defined_hotkey> LIKE LINE OF lt_user_defined_hotkeys.
|
||||
|
||||
rt_hotkeys = get_default_hotkeys( ).
|
||||
|
||||
" Override default hotkeys with user defined
|
||||
lo_settings = zcl_abapgit_persist_settings=>get_instance( )->read( ).
|
||||
lt_user_defined_hotkeys = lo_settings->get_hotkeys( ).
|
||||
|
||||
LOOP AT rt_hotkeys ASSIGNING <ls_hotkey>.
|
||||
|
||||
READ TABLE lt_user_defined_hotkeys ASSIGNING <ls_user_defined_hotkey>
|
||||
WITH TABLE KEY action
|
||||
COMPONENTS action = <ls_hotkey>-action.
|
||||
IF sy-subrc = 0.
|
||||
<ls_hotkey>-hotkey = <ls_user_defined_hotkey>-hotkey.
|
||||
ELSEIF lines( lt_user_defined_hotkeys ) > 0.
|
||||
" User removed the hotkey
|
||||
DELETE TABLE rt_hotkeys FROM <ls_hotkey>.
|
||||
ENDIF.
|
||||
|
||||
ENDLOOP.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_default_hotkeys.
|
||||
|
||||
DATA: lt_page_hotkeys LIKE mt_hotkeys.
|
||||
|
||||
rt_default_hotkeys = get_global_hotkeys( ).
|
||||
|
||||
TRY.
|
||||
CALL METHOD me->('ZIF_ABAPGIT_GUI_PAGE_HOTKEY~GET_HOTKEY_ACTIONS')
|
||||
RECEIVING
|
||||
rt_hotkey_actions = lt_page_hotkeys.
|
||||
|
||||
INSERT LINES OF lt_page_hotkeys INTO TABLE rt_default_hotkeys.
|
||||
|
||||
CATCH cx_root.
|
||||
" Current page doesn't implement hotkey interface, do nothing
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
|
|
@ -44,6 +44,9 @@ CLASS zcl_abapgit_gui_page_settings DEFINITION
|
|||
METHODS render_icon_scaling
|
||||
RETURNING
|
||||
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
|
||||
METHODS render_ui_theme
|
||||
RETURNING
|
||||
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
|
||||
METHODS render_adt_jump_enabled
|
||||
RETURNING
|
||||
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
|
||||
|
@ -108,7 +111,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_gui_page_settings IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_GUI_PAGE_SETTINGS IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD constructor.
|
||||
|
@ -246,6 +249,13 @@ CLASS zcl_abapgit_gui_page_settings IMPLEMENTATION.
|
|||
mo_settings->set_icon_scaling( '' ).
|
||||
ENDIF.
|
||||
|
||||
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = 'ui_theme'.
|
||||
IF sy-subrc = 0.
|
||||
mo_settings->set_ui_theme( <ls_post_field>-value ).
|
||||
ELSE.
|
||||
mo_settings->set_ui_theme( zcl_abapgit_settings=>c_ui_theme-default ).
|
||||
ENDIF.
|
||||
|
||||
post_hotkeys( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
@ -421,6 +431,7 @@ CLASS zcl_abapgit_gui_page_settings IMPLEMENTATION.
|
|||
ro_html->add( render_start_up( ) ).
|
||||
ro_html->add( render_max_lines( ) ).
|
||||
ro_html->add( render_icon_scaling( ) ).
|
||||
ro_html->add( render_ui_theme( ) ).
|
||||
ro_html->add( |<hr>| ).
|
||||
ro_html->add( render_adt_jump_enabled( ) ).
|
||||
ro_html->add( |<hr>| ).
|
||||
|
@ -713,6 +724,46 @@ CLASS zcl_abapgit_gui_page_settings IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD render_ui_theme.
|
||||
|
||||
" TODO: unify with render_icon_scaling, make list component
|
||||
|
||||
DATA:
|
||||
BEGIN OF ls_sel,
|
||||
default TYPE string,
|
||||
dark TYPE string,
|
||||
belize TYPE string,
|
||||
END OF ls_sel.
|
||||
|
||||
CASE mo_settings->get_ui_theme( ).
|
||||
WHEN zcl_abapgit_settings=>c_ui_theme-default.
|
||||
ls_sel-default = ' selected'.
|
||||
WHEN zcl_abapgit_settings=>c_ui_theme-dark.
|
||||
ls_sel-dark = ' selected'.
|
||||
WHEN zcl_abapgit_settings=>c_ui_theme-belize.
|
||||
ls_sel-belize = ' selected'.
|
||||
ENDCASE.
|
||||
|
||||
CREATE OBJECT ro_html.
|
||||
|
||||
ro_html->add( |<h2>UI Theme</h2>| ).
|
||||
ro_html->add( |<label for="ui_theme">UI Theme</label>| ).
|
||||
ro_html->add( |<br>| ).
|
||||
ro_html->add( |<select name="ui_theme" size="3">| ).
|
||||
ro_html->add( |<option value="{ zcl_abapgit_settings=>c_ui_theme-default }"{
|
||||
ls_sel-default }>{ zcl_abapgit_settings=>c_ui_theme-default }</option>| ).
|
||||
ro_html->add( |<option value="{ zcl_abapgit_settings=>c_ui_theme-dark }"{
|
||||
ls_sel-dark }>{ zcl_abapgit_settings=>c_ui_theme-dark }</option>| ).
|
||||
ro_html->add( |<option value="{ zcl_abapgit_settings=>c_ui_theme-belize }"{
|
||||
ls_sel-belize }>{ zcl_abapgit_settings=>c_ui_theme-belize }</option>| ).
|
||||
ro_html->add( |</select>| ).
|
||||
|
||||
ro_html->add( |<br>| ).
|
||||
ro_html->add( |<br>| ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD validate_settings.
|
||||
|
||||
IF ( mo_settings->get_proxy_url( ) IS NOT INITIAL AND mo_settings->get_proxy_port( ) IS INITIAL ) OR
|
||||
|
|
|
@ -129,6 +129,17 @@ CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION.
|
|||
iv_mime_name = 'ZABAPGIT_CSS_COMMON'
|
||||
iv_inline = concat_lines_of( table = lt_inline sep = cl_abap_char_utilities=>newline ) ).
|
||||
|
||||
CLEAR lt_inline.
|
||||
" @@abapmerge include zabapgit_css_theme_default.w3mi.data.css > _inline '$$'.
|
||||
ro_asset_man->register_asset(
|
||||
iv_url = 'css/theme-default.css'
|
||||
iv_type = 'text/css'
|
||||
iv_mime_name = 'ZABAPGIT_CSS_THEME_DEFAULT'
|
||||
iv_inline = concat_lines_of( table = lt_inline sep = cl_abap_char_utilities=>newline ) ).
|
||||
|
||||
" TODO theme-dark
|
||||
" TODO theme belize
|
||||
|
||||
CLEAR lt_inline.
|
||||
" @@abapmerge include zabapgit_js_common.w3mi.data.js > _inline '$$'.
|
||||
ro_asset_man->register_asset(
|
||||
|
|
|
@ -10,6 +10,13 @@ CLASS zcl_abapgit_settings DEFINITION PUBLIC CREATE PUBLIC.
|
|||
small TYPE c VALUE 'S',
|
||||
END OF c_icon_scaling.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_ui_theme,
|
||||
default TYPE string VALUE 'default',
|
||||
dark TYPE string VALUE 'dark',
|
||||
belize TYPE string VALUE 'belize',
|
||||
END OF c_ui_theme.
|
||||
|
||||
METHODS:
|
||||
set_proxy_url
|
||||
IMPORTING
|
||||
|
@ -128,7 +135,13 @@ CLASS zcl_abapgit_settings DEFINITION PUBLIC CREATE PUBLIC.
|
|||
VALUE(rv_scaling) TYPE zif_abapgit_definitions=>ty_s_user_settings-icon_scaling,
|
||||
set_icon_scaling
|
||||
IMPORTING
|
||||
iv_scaling TYPE zif_abapgit_definitions=>ty_s_user_settings-icon_scaling.
|
||||
iv_scaling TYPE zif_abapgit_definitions=>ty_s_user_settings-icon_scaling,
|
||||
get_ui_theme
|
||||
RETURNING
|
||||
VALUE(rv_ui_theme) TYPE zif_abapgit_definitions=>ty_s_user_settings-ui_theme,
|
||||
set_ui_theme
|
||||
IMPORTING
|
||||
iv_ui_theme TYPE zif_abapgit_definitions=>ty_s_user_settings-ui_theme.
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
TYPES: BEGIN OF ty_s_settings,
|
||||
|
@ -152,7 +165,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_settings IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_SETTINGS IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD get_adt_jump_enabled.
|
||||
|
@ -250,6 +263,11 @@ CLASS zcl_abapgit_settings IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_ui_theme.
|
||||
rv_ui_theme = ms_user_settings-ui_theme.
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_user_settings.
|
||||
rs_settings = ms_user_settings.
|
||||
ENDMETHOD.
|
||||
|
@ -367,6 +385,16 @@ CLASS zcl_abapgit_settings IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD set_ui_theme.
|
||||
ms_user_settings-ui_theme = iv_ui_theme.
|
||||
IF ms_user_settings-ui_theme <> c_ui_theme-default
|
||||
AND ms_user_settings-ui_theme <> c_ui_theme-dark
|
||||
AND ms_user_settings-ui_theme <> c_ui_theme-belize.
|
||||
ms_user_settings-ui_theme = c_ui_theme-default. " Reset to default
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD set_user_settings.
|
||||
ms_user_settings = is_user_settings.
|
||||
|
||||
|
|
|
@ -340,6 +340,7 @@ INTERFACE zif_abapgit_definitions
|
|||
hotkeys TYPE tty_hotkey,
|
||||
parallel_proc_disabled TYPE abap_bool,
|
||||
icon_scaling TYPE c LENGTH 1,
|
||||
ui_theme TYPE string,
|
||||
END OF ty_s_user_settings .
|
||||
TYPES:
|
||||
tty_dokil TYPE STANDARD TABLE OF dokil
|
||||
|
|
Loading…
Reference in New Issue
Block a user