Commit faa24ec4 authored by Noah Davis's avatar Noah Davis 🌵
Browse files

Remove breezemetrics.cpp and put values back into breezemetrics.h

Having the values split into a separate cpp file made the code too
difficult to navigate.
parent e575c42d
......@@ -94,7 +94,6 @@ set(breeze_PART_SRCS
breezestyleplugin.cpp
breezetileset.cpp
breezewindowmanager.cpp
breezemetrics.cpp
)
kconfig_add_kcfg_files(breeze_PART_SRCS breezestyleconfigdata.kcfgc)
......
#include "breezemetrics.h"
namespace Breeze {
//BEGIN PenWidth
constexpr qreal PenWidth::Symbol = 1.01;
constexpr int PenWidth::Frame = 1;
constexpr int PenWidth::Shadow = 1;
constexpr int PenWidth::NoPen = 0;
//END PenWidth
//BEGIN Metrics
constexpr int Metrics::Frame_FrameWidth = 2;
constexpr int Metrics::Frame_FrameRadius = 3;
constexpr int Metrics::Layout_TopLevelMarginWidth = 10;
constexpr int Metrics::Layout_ChildMarginWidth = 6;
constexpr int Metrics::Layout_DefaultSpacing = 6;
constexpr int Metrics::LineEdit_FrameWidth = 6;
constexpr int Metrics::Menu_FrameWidth = 0;
constexpr int Metrics::MenuItem_MarginWidth = 5;
constexpr int Metrics::MenuItem_MarginHeight = 3;
constexpr int Metrics::MenuItem_ItemSpacing = 4;
constexpr int Metrics::MenuItem_AcceleratorSpace = 16;
constexpr int Metrics::MenuButton_IndicatorWidth = 20;
constexpr int Metrics::ComboBox_FrameWidth = 6;
constexpr int Metrics::SpinBox_FrameWidth = LineEdit_FrameWidth;
constexpr int Metrics::SpinBox_ArrowButtonWidth = 20;
constexpr int Metrics::GroupBox_TitleMarginWidth = 4;
constexpr int Metrics::Button_MinWidth = 80;
constexpr int Metrics::Button_MarginWidth = 6;
constexpr int Metrics::Button_ItemSpacing = 4;
constexpr int Metrics::ToolButton_MarginWidth = 6;
constexpr int Metrics::ToolButton_ItemSpacing = 4;
constexpr int Metrics::ToolButton_InlineIndicatorWidth = 12;
constexpr int Metrics::CheckBox_Size = 20;
constexpr int Metrics::CheckBox_FocusMarginWidth = 2;
constexpr int Metrics::CheckBox_ItemSpacing = 4;
constexpr int Metrics::MenuBarItem_MarginWidth = 10;
constexpr int Metrics::MenuBarItem_MarginHeight = 6;
constexpr int Metrics::ScrollBar_Extend = 21;
constexpr int Metrics::ScrollBar_SliderWidth = 6;
constexpr int Metrics::ScrollBar_MinSliderHeight = 20;
constexpr int Metrics::ScrollBar_NoButtonHeight = (ScrollBar_Extend-ScrollBar_SliderWidth)/2;
constexpr int Metrics::ScrollBar_SingleButtonHeight = ScrollBar_Extend;
constexpr int Metrics::ScrollBar_DoubleButtonHeight = 2*ScrollBar_Extend;
constexpr int Metrics::ToolBar_FrameWidth = 2;
constexpr int Metrics::ToolBar_HandleExtent = 10;
constexpr int Metrics::ToolBar_HandleWidth = 6;
constexpr int Metrics::ToolBar_SeparatorWidth = 8;
constexpr int Metrics::ToolBar_ExtensionWidth = 20;
constexpr int Metrics::ToolBar_ItemSpacing = 0;
constexpr int Metrics::ProgressBar_BusyIndicatorSize = 14;
constexpr int Metrics::ProgressBar_Thickness = 6;
constexpr int Metrics::ProgressBar_ItemSpacing = 4;
constexpr int Metrics::TitleBar_MarginWidth = 4;
constexpr int Metrics::Slider_TickLength = 8;
constexpr int Metrics::Slider_TickMarginWidth = 2;
constexpr int Metrics::Slider_GrooveThickness = 6;
constexpr int Metrics::Slider_ControlThickness = 20;
constexpr int Metrics::TabBar_TabMarginHeight = 4;
constexpr int Metrics::TabBar_TabMarginWidth = 8;
constexpr int Metrics::TabBar_TabMinWidth = 80;
constexpr int Metrics::TabBar_TabMinHeight = 30;
constexpr int Metrics::TabBar_TabItemSpacing = 8;
constexpr int Metrics::TabBar_TabOverlap = 1;
constexpr int Metrics::TabBar_BaseOverlap = 2;
constexpr int Metrics::TabWidget_MarginWidth = 4;
constexpr int Metrics::ToolBox_TabMinWidth = 80;
constexpr int Metrics::ToolBox_TabItemSpacing = 4;
constexpr int Metrics::ToolBox_TabMarginWidth = 8;
constexpr int Metrics::ToolTip_FrameWidth = 3;
constexpr int Metrics::Header_MarginWidth = 6;
constexpr int Metrics::Header_ItemSpacing = 4;
constexpr int Metrics::Header_ArrowSize = 10;
constexpr int Metrics::ItemView_ArrowSize = 10;
constexpr int Metrics::ItemView_ItemMarginWidth = 3;
constexpr int Metrics::SidePanel_ItemMarginWidth = 4;
constexpr int Metrics::Splitter_SplitterWidth = 1;
constexpr int Metrics::Shadow_Overlap = 2;
//END Metrics
}
#ifndef breezemetrics_h
#define breezemetrics_h
#include <QtCore>
/*************************************************************************
* Copyright (C) 2014 by Hugo Pereira Da Costa <hugo.pereira@free.fr> *
* Copyright (C) 2020 by Noah Davis <noahadvs@gmail.com> *
......@@ -23,6 +21,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
*************************************************************************/
#include <QtGlobal>
namespace Breeze
{
//* standard pen widths
......@@ -33,135 +33,135 @@ namespace Breeze
* as long as it isn't too visible.
*/
// The standard pen stroke width for symbols.
static const qreal Symbol;
static constexpr qreal Symbol = 1.01;
// The standard pen stroke width for frames.
static const int Frame;
static constexpr int Frame = 1;
// The standard pen stroke width for shadows.
static const int Shadow;
static constexpr int Shadow = 1;
// A value for pen width arguments to make it clear that there is no pen stroke
static const int NoPen;
static constexpr int NoPen = 0;
};
//* metrics
struct Metrics
{
// frames
static const int Frame_FrameWidth;
static const int Frame_FrameRadius;
static constexpr int Frame_FrameWidth = 2;
static constexpr int Frame_FrameRadius = 3;
// layout
static const int Layout_TopLevelMarginWidth;
static const int Layout_ChildMarginWidth;
static const int Layout_DefaultSpacing;
static constexpr int Layout_TopLevelMarginWidth = 10;
static constexpr int Layout_ChildMarginWidth = 6;
static constexpr int Layout_DefaultSpacing = 6;
// line editors
static const int LineEdit_FrameWidth;
static constexpr int LineEdit_FrameWidth = 6;
// menu items
static const int Menu_FrameWidth;
static const int MenuItem_MarginWidth;
static const int MenuItem_MarginHeight;
static const int MenuItem_ItemSpacing;
static const int MenuItem_AcceleratorSpace;
static const int MenuButton_IndicatorWidth;
static constexpr int Menu_FrameWidth = 0;
static constexpr int MenuItem_MarginWidth = 5;
static constexpr int MenuItem_MarginHeight = 3;
static constexpr int MenuItem_ItemSpacing = 4;
static constexpr int MenuItem_AcceleratorSpace = 16;
static constexpr int MenuButton_IndicatorWidth = 20;
// combobox
static const int ComboBox_FrameWidth;
static constexpr int ComboBox_FrameWidth = 6;
// spinbox
static const int SpinBox_FrameWidth;
static const int SpinBox_ArrowButtonWidth;
static constexpr int SpinBox_FrameWidth = LineEdit_FrameWidth;
static constexpr int SpinBox_ArrowButtonWidth = 20;
// groupbox title margin
static const int GroupBox_TitleMarginWidth;
static constexpr int GroupBox_TitleMarginWidth = 4;
// buttons
static const int Button_MinWidth;
static const int Button_MarginWidth;
static const int Button_ItemSpacing;
static constexpr int Button_MinWidth = 80;
static constexpr int Button_MarginWidth = 6;
static constexpr int Button_ItemSpacing = 4;
// tool buttons
static const int ToolButton_MarginWidth;
static const int ToolButton_ItemSpacing;
static const int ToolButton_InlineIndicatorWidth;
static constexpr int ToolButton_MarginWidth = 6;
static constexpr int ToolButton_ItemSpacing = 4;
static constexpr int ToolButton_InlineIndicatorWidth = 12;
// checkboxes and radio buttons
static const int CheckBox_Size;
static const int CheckBox_FocusMarginWidth;
static const int CheckBox_ItemSpacing;
static constexpr int CheckBox_Size = 20;
static constexpr int CheckBox_FocusMarginWidth = 2;
static constexpr int CheckBox_ItemSpacing = 4;
// menubar items
static const int MenuBarItem_MarginWidth;
static const int MenuBarItem_MarginHeight;
static constexpr int MenuBarItem_MarginWidth = 10;
static constexpr int MenuBarItem_MarginHeight = 6;
// scrollbars
static const int ScrollBar_Extend;
static const int ScrollBar_SliderWidth;
static const int ScrollBar_MinSliderHeight;
static const int ScrollBar_NoButtonHeight;
static const int ScrollBar_SingleButtonHeight;
static const int ScrollBar_DoubleButtonHeight;
static constexpr int ScrollBar_Extend = 21;
static constexpr int ScrollBar_SliderWidth = 6;
static constexpr int ScrollBar_MinSliderHeight = 20;
static constexpr int ScrollBar_NoButtonHeight = (ScrollBar_Extend-ScrollBar_SliderWidth)/2;
static constexpr int ScrollBar_SingleButtonHeight = ScrollBar_Extend;
static constexpr int ScrollBar_DoubleButtonHeight = 2*ScrollBar_Extend;
// toolbars
static const int ToolBar_FrameWidth;
static const int ToolBar_HandleExtent;
static const int ToolBar_HandleWidth;
static const int ToolBar_SeparatorWidth;
static const int ToolBar_ExtensionWidth;
static const int ToolBar_ItemSpacing;
static constexpr int ToolBar_FrameWidth = 2;
static constexpr int ToolBar_HandleExtent = 10;
static constexpr int ToolBar_HandleWidth = 6;
static constexpr int ToolBar_SeparatorWidth = 8;
static constexpr int ToolBar_ExtensionWidth = 20;
static constexpr int ToolBar_ItemSpacing = 0;
// progressbars
static const int ProgressBar_BusyIndicatorSize;
static const int ProgressBar_Thickness;
static const int ProgressBar_ItemSpacing;
static constexpr int ProgressBar_BusyIndicatorSize = 14;
static constexpr int ProgressBar_Thickness = 6;
static constexpr int ProgressBar_ItemSpacing = 4;
// mdi title bar
static const int TitleBar_MarginWidth;
static constexpr int TitleBar_MarginWidth = 4;
// sliders
static const int Slider_TickLength;
static const int Slider_TickMarginWidth;
static const int Slider_GrooveThickness;
static const int Slider_ControlThickness;
static constexpr int Slider_TickLength = 8;
static constexpr int Slider_TickMarginWidth = 2;
static constexpr int Slider_GrooveThickness = 6;
static constexpr int Slider_ControlThickness = 20;
// tabbar
static const int TabBar_TabMarginHeight;
static const int TabBar_TabMarginWidth;
static const int TabBar_TabMinWidth;
static const int TabBar_TabMinHeight;
static const int TabBar_TabItemSpacing;
static const int TabBar_TabOverlap;
static const int TabBar_BaseOverlap;
static constexpr int TabBar_TabMarginHeight = 4;
static constexpr int TabBar_TabMarginWidth = 8;
static constexpr int TabBar_TabMinWidth = 80;
static constexpr int TabBar_TabMinHeight = 30;
static constexpr int TabBar_TabItemSpacing = 8;
static constexpr int TabBar_TabOverlap = 1;
static constexpr int TabBar_BaseOverlap = 2;
// tab widget
static const int TabWidget_MarginWidth;
static constexpr int TabWidget_MarginWidth = 4;
// toolbox
static const int ToolBox_TabMinWidth;
static const int ToolBox_TabItemSpacing;
static const int ToolBox_TabMarginWidth;
static constexpr int ToolBox_TabMinWidth = 80;
static constexpr int ToolBox_TabItemSpacing = 4;
static constexpr int ToolBox_TabMarginWidth = 8;
// tooltips
static const int ToolTip_FrameWidth;
static constexpr int ToolTip_FrameWidth = 3;
// list headers
static const int Header_MarginWidth;
static const int Header_ItemSpacing;
static const int Header_ArrowSize;
static constexpr int Header_MarginWidth = 6;
static constexpr int Header_ItemSpacing = 4;
static constexpr int Header_ArrowSize = 10;
// tree view
static const int ItemView_ArrowSize;
static const int ItemView_ItemMarginWidth;
static const int SidePanel_ItemMarginWidth;
static constexpr int ItemView_ArrowSize = 10;
static constexpr int ItemView_ItemMarginWidth = 3;
static constexpr int SidePanel_ItemMarginWidth = 4;
// splitter
static const int Splitter_SplitterWidth;
static constexpr int Splitter_SplitterWidth = 1;
// shadow dimensions
static const int Shadow_Overlap;
static constexpr int Shadow_Overlap = 2;
};
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment