Skip to content

Commit

Permalink
chore: remove Chrome-specific padding
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 26, 2024
1 parent 0fdadf5 commit aee9b81
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
1 change: 0 additions & 1 deletion patches/chromium/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,4 @@ fix_font_face_resolution_when_renderer_is_blocked.patch
feat_enable_passing_exit_code_on_service_process_crash.patch
chore_remove_reference_to_chrome_browser_themes.patch
x11_use_localized_display_label_only_for_browser_process.patch
revert_power_update_trace_counter_in_power_monitor.patch
feat_enable_customizing_symbol_color_in_framecaptionbutton.patch
6 changes: 4 additions & 2 deletions shell/browser/api/electron_api_base_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "shell/browser/ui/views/win_frame_view.h"
#include "shell/browser/ui/win/taskbar_host.h"
#include "ui/base/win/shell.h"
#elif BUILDFLAG (IS_LINUX)
#elif BUILDFLAG(IS_LINUX)
#include "shell/browser/ui/views/opaque_frame_view.h"
#endif

Expand Down Expand Up @@ -1047,7 +1047,7 @@ void BaseWindow::SetAppDetails(const gin_helper::Dictionary& options) {

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
void BaseWindow::SetTitleBarOverlay(const gin_helper::Dictionary& options,
gin_helper::Arguments* args) {
gin_helper::Arguments* args) {
// Ensure WCO is already enabled on this window
if (!window_->IsWindowControlsOverlayEnabled()) {
args->ThrowError("Titlebar overlay is not enabled");
Expand Down Expand Up @@ -1295,6 +1295,8 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setThumbnailClip", &BaseWindow::SetThumbnailClip)
.SetMethod("setThumbnailToolTip", &BaseWindow::SetThumbnailToolTip)
.SetMethod("setAppDetails", &BaseWindow::SetAppDetails)
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
.SetMethod("setTitleBarOverlay", &BaseWindow::SetTitleBarOverlay)
#endif
.SetProperty("id", &BaseWindow::GetID);
Expand Down
12 changes: 1 addition & 11 deletions shell/browser/ui/views/opaque_frame_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ bool OpaqueFrameView::IsFrameCondensed() const {
}

gfx::Insets OpaqueFrameView::RestoredFrameBorderInsets() const {
return gfx::Insets(kFrameBorderThickness);
return gfx::Insets();
}

gfx::Insets OpaqueFrameView::RestoredFrameEdgeInsets() const {
Expand Down Expand Up @@ -543,16 +543,6 @@ int OpaqueFrameView::GetTopAreaHeight() const {
int OpaqueFrameView::GetWindowCaptionSpacing(views::FrameButton button_id,
bool leading_spacing,
bool is_leading_button) const {
if (leading_spacing) {
if (is_leading_button) {
// If we're the first button and maximized, add width to the right
// hand side of the screen.
return IsFrameCondensed() && is_leading_button
? kFrameBorderThickness -
views::NonClientFrameView::kFrameShadowThickness
: 0;
}
}
return 0;
}

Expand Down
6 changes: 0 additions & 6 deletions shell/browser/ui/views/opaque_frame_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ class OpaqueFrameView : public FramelessView {
// Constants used by OpaqueBrowserFrameView as well.
static const int kContentEdgeShadowThickness;

// The frame border is only visible in restored mode and is hardcoded to 4
// px on each side regardless of the system window border size. This is
// overridable by subclasses, so RestoredFrameBorderInsets() should be used
// instead of using this constant directly.
static constexpr int kFrameBorderThickness = 4;

static constexpr int kNonClientExtraTopThickness = 1;

OpaqueFrameView();
Expand Down

0 comments on commit aee9b81

Please sign in to comment.