From c3af5ae0cc6e74ae3808dc239ca1497d570895b2 Mon Sep 17 00:00:00 2001 From: vedhav Date: Thu, 3 Oct 2024 17:16:59 +0530 Subject: [PATCH] push local style changes --- R/plot_with_settings.R | 34 ++++++++++++++++++---------------- R/standard_layout.R | 29 ++++++++++++----------------- inst/css/custom.css | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 33 deletions(-) diff --git a/R/plot_with_settings.R b/R/plot_with_settings.R index ce9aefc2..128efc3f 100644 --- a/R/plot_with_settings.R +++ b/R/plot_with_settings.R @@ -19,25 +19,27 @@ plot_with_settings_ui <- function(id) { ) )), include_css_files("plot_with_settings"), - tags$div( + bslib::card( id = ns("plot-with-settings"), tags$div( - class = "plot-settings-buttons", - type_download_ui(ns("downbutton")), - actionButton( - ns("expand"), - label = character(0), - icon = icon("up-right-and-down-left-from-center"), - class = "btn-sm" + tags$div( + class = "plot-settings-buttons", + type_download_ui(ns("downbutton")), + actionLink( + ns("expand"), + label = character(0), + icon = icon("up-right-and-down-left-from-center"), + class = "btn-sm" + ), + bslib::popover( + icon("maximize"), + uiOutput(ns("slider_ui")), + uiOutput(ns("width_warning")), + options = list(triggers = "hover focus") + ) ), - bslib::popover( - icon("maximize"), - uiOutput(ns("slider_ui")), - uiOutput(ns("width_warning")), - options = list(triggers = "hover focus") - ) - ), - uiOutput(ns("plot_out_main"), class = "plot_out_container", width = "100%") + uiOutput(ns("plot_out_main"), class = "plot_out_container", width = "100%") + ) ) ) } diff --git a/R/standard_layout.R b/R/standard_layout.R index 8633aeed..3096a7ea 100644 --- a/R/standard_layout.R +++ b/R/standard_layout.R @@ -59,31 +59,26 @@ standard_layout <- function(output, # if encoding=NULL then forms is placed below output tag_output <- tags$div( - class = "well", - tags$div(class = "pre-output", pre_output), - tags$div(class = "output", output), - tags$div(class = "post-output", post_output) + class = "teal-widgets standard-layout", + tags$div(class = "standard-layout-pre-output", pre_output), + tags$div(class = "standard-layout-output", output), + tags$div(class = "standard-layout-post-output", post_output) ) tag_enc_out <- if (!is.null(encoding)) { - tagList( - column( - width = 3, - tags$div(class = "well", encoding), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + encoding, if (is.null(forms)) { NULL } else { - tagList( - tags$br(), - tags$div(class = "form-group", forms) - ) + forms } ), - column(width = 9, tag_output) + tag_output ) } else { - column( - width = 12, + tags$div( tag_output, if (is.null(forms)) { NULL @@ -93,8 +88,8 @@ standard_layout <- function(output, ) } - fluidRow( - class = "teal-widgets standard-layout", + bslib::page_fluid( + # class = "teal-widgets standard-layout", tag_enc_out ) } diff --git a/inst/css/custom.css b/inst/css/custom.css index 55a6e22c..1c9080b9 100644 --- a/inst/css/custom.css +++ b/inst/css/custom.css @@ -19,3 +19,35 @@ --bs-btn-padding-x: 1em; --bs-btn-padding-y: 0.5em; } + +.teal-widgets.plot-modal .modal-body { + max-width: 90vw; + max-height: 70vh; + overflow: scroll; +} + +.modal-footer { + padding: 1rem; +} + +.plot-settings-buttons { + display: flex; + justify-content: flex-end; + align-items: center; +} + +.plot-settings-buttons a { + color: black; +} + +.plot-settings-buttons i { + margin: 0 0.5rem; +} + +.teal-widgets.standard-layout > .standard-layout-output .card { + padding: 0; +} + +.bslib-sidebar-layout > .sidebar > .sidebar-content { + padding-top: 2rem; +}