Change default width of abapgit (#4751)

* Change default width of abapgit

* Center settings forms
This commit is contained in:
Frederik Hudák 2021-05-12 18:10:33 +02:00 committed by GitHub
parent 212fcb779e
commit 50bd3941e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 7 deletions

View File

@ -7,6 +7,16 @@
body {
overflow-x: hidden;
}
body.centered {
max-width: 1280px;
margin: 0 auto;
}
body.full_width {
width:100%;
}
a, a:visited {
text-decoration: none;
}
@ -1043,13 +1053,15 @@ settings_tab tr:first-child td { border-top: 0px; }
/* DIALOGS */
.dialog {
margin: 0 auto;
margin-top: 1em;
margin-bottom: 1em;
border: 1px solid;
padding: 1em 1em;
border-radius: 6px;
text-align: left;
}
.dialog-form {
margin: 1em 1em 1em 1em;
width: 600px;
}
.dialog-form-center {

View File

@ -262,6 +262,16 @@ RepoOverViewHelper.prototype.toggleRepoListDetail = function (forceDisplay) {
RepoOverViewHelper.prototype.toggleItemsDetail = function(forceDisplay){
if (this.detailCssClass) {
this.isDetailsDisplayed = forceDisplay || !this.isDetailsDisplayed;
// change layout to wide if details are displayed
if (this.isDetailsDisplayed) {
document.body.classList.remove("centered");
document.body.classList.add("full_width");
} else {
document.body.classList.add("centered");
document.body.classList.remove("full_width");
}
this.detailCssClass.style.display = this.isDetailsDisplayed ? "" : "none";
this.actionCssClass.style.display = this.isDetailsDisplayed ? "none" : "";
var icon = document.getElementById("icon-filter-detail");

View File

@ -13,8 +13,15 @@ CLASS zcl_abapgit_gui_page DEFINITION PUBLIC ABSTRACT
PROTECTED SECTION.
CONSTANTS:
BEGIN OF c_page_layout,
centered TYPE string VALUE `centered`,
full_width TYPE string VALUE `full_width`,
END OF c_page_layout.
TYPES:
BEGIN OF ty_control,
page_layout TYPE string,
page_title TYPE string,
page_menu TYPE REF TO zcl_abapgit_html_toolbar,
END OF ty_control .
@ -77,13 +84,14 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE IMPLEMENTATION.
CLASS zcl_abapgit_gui_page IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
mo_settings = zcl_abapgit_persist_settings=>get_instance( )->read( ).
ms_control-page_layout = c_page_layout-centered.
ENDMETHOD.
@ -315,7 +323,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE IMPLEMENTATION.
ri_html->add( '<!DOCTYPE html>' ).
ri_html->add( '<html lang="en">' ).
ri_html->add( html_head( ) ).
ri_html->add( '<body>' ).
ri_html->add( |<body class="{ ms_control-page_layout }">| ).
ri_html->add( title( ) ).
ri_html->add( render_content( ) ). " TODO -> render child

View File

@ -104,6 +104,7 @@ CLASS zcl_abapgit_gui_page_diff DEFINITION
METHODS build_menu
RETURNING
VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar .
METHODS set_layout.
METHODS render_content
REDEFINITION .
@ -205,7 +206,7 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_DIFF IMPLEMENTATION.
CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
METHOD add_filter_sub_menu.
@ -484,6 +485,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_DIFF IMPLEMENTATION.
super->constructor( ).
ms_control-page_title = 'Diff'.
mv_unified = zcl_abapgit_persistence_user=>get_instance( )->get_diff_unified( ).
set_layout( ).
mv_repo_key = iv_key.
mo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( iv_key ).
@ -505,6 +507,16 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_DIFF IMPLEMENTATION.
ENDMETHOD.
METHOD set_layout.
IF mv_unified = abap_true.
ms_control-page_layout = c_page_layout-centered.
ELSE.
ms_control-page_layout = c_page_layout-full_width.
ENDIF.
ENDMETHOD.
METHOD get_normalized_fname_with_path.
@ -602,7 +614,6 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_DIFF IMPLEMENTATION.
DATA: ls_diff_file LIKE LINE OF mt_diff_files,
li_progress TYPE REF TO zif_abapgit_progress.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
li_progress = zcl_abapgit_progress=>get_instance( lines( mt_diff_files ) ).
@ -996,6 +1007,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_DIFF IMPLEMENTATION.
WHEN c_actions-toggle_unified. " Toggle file diplay
mv_unified = zcl_abapgit_persistence_user=>get_instance( )->toggle_diff_unified( ).
set_layout( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-toggle_hidden_chars. " Toggle display of hidden characters

View File

@ -363,6 +363,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_PATCH IMPLEMENTATION.
" While patching we always want to be in split mode
CLEAR: mv_unified.
set_layout( ).
CREATE OBJECT mo_stage.
ms_control-page_title = 'Patch'.