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

Move Breeze::Metrics into breezemetrics.h to reduce recompilations

Also remove some unecessary inclusions of breeze.h
parent 58ef0703
......@@ -19,7 +19,7 @@
#include "breezebusyindicatorengine.h"
#include "breeze.h"
#include "breezemetrics.h"
#include <QVariant>
......
......@@ -39,147 +39,6 @@ namespace Breeze
//@}
//* metrics
enum Metrics
{
// frames
Frame_FrameWidth = 2,
Frame_FrameRadius = 3,
// layout
Layout_TopLevelMarginWidth = 10,
Layout_ChildMarginWidth = 6,
Layout_DefaultSpacing = 6,
// line editors
LineEdit_FrameWidth = 6,
// menu items
Menu_FrameWidth = 0,
MenuItem_MarginWidth = 5,
MenuItem_MarginHeight = 3,
MenuItem_ItemSpacing = 4,
MenuItem_AcceleratorSpace = 16,
MenuButton_IndicatorWidth = 20,
// combobox
ComboBox_FrameWidth = 6,
// spinbox
SpinBox_FrameWidth = LineEdit_FrameWidth,
SpinBox_ArrowButtonWidth = 20,
// groupbox title margin
GroupBox_TitleMarginWidth = 4,
// buttons
Button_MinWidth = 80,
Button_MarginWidth = 6,
Button_ItemSpacing = 4,
// tool buttons
ToolButton_MarginWidth = 6,
ToolButton_ItemSpacing = 4,
ToolButton_InlineIndicatorWidth = 12,
// checkboxes and radio buttons
CheckBox_Size = 20,
CheckBox_FocusMarginWidth = 2,
CheckBox_ItemSpacing = 4,
// menubar items
MenuBarItem_MarginWidth = 10,
MenuBarItem_MarginHeight = 6,
// scrollbars
ScrollBar_Extend = 21,
ScrollBar_SliderWidth = 6,
ScrollBar_MinSliderHeight = 20,
ScrollBar_NoButtonHeight = (ScrollBar_Extend-ScrollBar_SliderWidth)/2,
ScrollBar_SingleButtonHeight = ScrollBar_Extend,
ScrollBar_DoubleButtonHeight = 2*ScrollBar_Extend,
// toolbars
ToolBar_FrameWidth = 2,
ToolBar_HandleExtent = 10,
ToolBar_HandleWidth = 6,
ToolBar_SeparatorWidth = 8,
ToolBar_ExtensionWidth = 20,
ToolBar_ItemSpacing = 0,
// progressbars
ProgressBar_BusyIndicatorSize = 14,
ProgressBar_Thickness = 6,
ProgressBar_ItemSpacing = 4,
// mdi title bar
TitleBar_MarginWidth = 4,
// sliders
Slider_TickLength = 8,
Slider_TickMarginWidth = 2,
Slider_GrooveThickness = 6,
Slider_ControlThickness = 20,
// tabbar
TabBar_TabMarginHeight = 4,
TabBar_TabMarginWidth = 8,
TabBar_TabMinWidth = 80,
TabBar_TabMinHeight = 30,
TabBar_TabItemSpacing = 8,
TabBar_TabOverlap = 1,
TabBar_BaseOverlap = 2,
// tab widget
TabWidget_MarginWidth = 4,
// toolbox
ToolBox_TabMinWidth = 80,
ToolBox_TabItemSpacing = 4,
ToolBox_TabMarginWidth = 8,
// tooltips
ToolTip_FrameWidth = 3,
// list headers
Header_MarginWidth = 6,
Header_ItemSpacing = 4,
Header_ArrowSize = 10,
// tree view
ItemView_ArrowSize = 10,
ItemView_ItemMarginWidth = 3,
SidePanel_ItemMarginWidth = 4,
// splitter
Splitter_SplitterWidth = 1,
// shadow dimensions
Shadow_Overlap = 2
};
//* standard pen widths
namespace PenWidth
{
/* Using 1 instead of slightly more than 1 causes symbols drawn with
* pen strokes to look skewed. The exact amount added does not matter
* as long as it isn't too visible.
*/
// The standard pen stroke width for symbols.
static constexpr qreal Symbol = 1.01;
// The standard pen stroke width for frames.
static constexpr int Frame = 1;
// The standard pen stroke width for shadows.
static constexpr int Shadow = 1;
// A value for pen width arguments to make it clear that there is no pen stroke
static constexpr int NoPen = 0;
}
//* animation mode
enum AnimationMode
{
......
......@@ -20,6 +20,7 @@
#include "breezeframeshadow.h"
#include "breeze.h"
#include "breezemetrics.h"
#include <QDebug>
#include <QAbstractScrollArea>
......
......@@ -19,7 +19,6 @@
#include "breezehelper.h"
#include "breeze.h"
#include "breezestyleconfigdata.h"
#include <KColorUtils>
......
......@@ -22,6 +22,7 @@
#include "breeze.h"
#include "breezemetrics.h"
#include "breezeanimationdata.h"
#include "config-breeze.h"
......
......@@ -19,7 +19,7 @@
#include "breezemdiwindowshadow.h"
#include "breeze.h"
#include "breezemetrics.h"
#include "breezeboxshadowrenderer.h"
#include "breezeshadowhelper.h"
#include "breezestyleconfigdata.h"
......
#ifndef breezemetrics_h
#define breezemetrics_h
/*************************************************************************
* Copyright (C) 2014 by Hugo Pereira Da Costa <hugo.pereira@free.fr> *
* Copyright (C) 2020 by Noah Davis <noahadvs@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
*************************************************************************/
namespace Breeze
{
//* standard pen widths
namespace PenWidth
{
/* Using 1 instead of slightly more than 1 causes symbols drawn with
* pen strokes to look skewed. The exact amount added does not matter
* as long as it isn't too visible.
*/
// The standard pen stroke width for symbols.
static constexpr qreal Symbol = 1.01;
// The standard pen stroke width for frames.
static constexpr int Frame = 1;
// The standard pen stroke width for shadows.
static constexpr int Shadow = 1;
// A value for pen width arguments to make it clear that there is no pen stroke
static constexpr int NoPen = 0;
}
//* metrics
enum Metrics
{
// frames
Frame_FrameWidth = 2,
Frame_FrameRadius = 3,
// layout
Layout_TopLevelMarginWidth = 10,
Layout_ChildMarginWidth = 6,
Layout_DefaultSpacing = 6,
// line editors
LineEdit_FrameWidth = 6,
// menu items
Menu_FrameWidth = 0,
MenuItem_MarginWidth = 5,
MenuItem_MarginHeight = 3,
MenuItem_ItemSpacing = 4,
MenuItem_AcceleratorSpace = 16,
MenuButton_IndicatorWidth = 20,
// combobox
ComboBox_FrameWidth = 6,
// spinbox
SpinBox_FrameWidth = LineEdit_FrameWidth,
SpinBox_ArrowButtonWidth = 20,
// groupbox title margin
GroupBox_TitleMarginWidth = 4,
// buttons
Button_MinWidth = 80,
Button_MarginWidth = 6,
Button_ItemSpacing = 4,
// tool buttons
ToolButton_MarginWidth = 6,
ToolButton_ItemSpacing = 4,
ToolButton_InlineIndicatorWidth = 12,
// checkboxes and radio buttons
CheckBox_Size = 20,
CheckBox_FocusMarginWidth = 2,
CheckBox_ItemSpacing = 4,
// menubar items
MenuBarItem_MarginWidth = 10,
MenuBarItem_MarginHeight = 6,
// scrollbars
ScrollBar_Extend = 21,
ScrollBar_SliderWidth = 6,
ScrollBar_MinSliderHeight = 20,
ScrollBar_NoButtonHeight = (ScrollBar_Extend-ScrollBar_SliderWidth)/2,
ScrollBar_SingleButtonHeight = ScrollBar_Extend,
ScrollBar_DoubleButtonHeight = 2*ScrollBar_Extend,
// toolbars
ToolBar_FrameWidth = 2,
ToolBar_HandleExtent = 10,
ToolBar_HandleWidth = 6,
ToolBar_SeparatorWidth = 8,
ToolBar_ExtensionWidth = 20,
ToolBar_ItemSpacing = 0,
// progressbars
ProgressBar_BusyIndicatorSize = 14,
ProgressBar_Thickness = 6,
ProgressBar_ItemSpacing = 4,
// mdi title bar
TitleBar_MarginWidth = 4,
// sliders
Slider_TickLength = 8,
Slider_TickMarginWidth = 2,
Slider_GrooveThickness = 6,
Slider_ControlThickness = 20,
// tabbar
TabBar_TabMarginHeight = 4,
TabBar_TabMarginWidth = 8,
TabBar_TabMinWidth = 80,
TabBar_TabMinHeight = 30,
TabBar_TabItemSpacing = 8,
TabBar_TabOverlap = 1,
TabBar_BaseOverlap = 2,
// tab widget
TabWidget_MarginWidth = 4,
// toolbox
ToolBox_TabMinWidth = 80,
ToolBox_TabItemSpacing = 4,
ToolBox_TabMarginWidth = 8,
// tooltips
ToolTip_FrameWidth = 3,
// list headers
Header_MarginWidth = 6,
Header_ItemSpacing = 4,
Header_ArrowSize = 10,
// tree view
ItemView_ArrowSize = 10,
ItemView_ItemMarginWidth = 3,
SidePanel_ItemMarginWidth = 4,
// splitter
Splitter_SplitterWidth = 1,
// shadow dimensions
Shadow_Overlap = 2
};
}
#endif
......@@ -20,7 +20,7 @@
#include "breezeshadowhelper.h"
#include "breeze.h"
#include "breezemetrics.h"
#include "breezeboxshadowrenderer.h"
#include "breezehelper.h"
#include "breezepropertynames.h"
......
......@@ -19,7 +19,6 @@
#include "breezestyle.h"
#include "breeze.h"
#include "breezeanimations.h"
#include "breezeframeshadow.h"
#include "breezemdiwindowshadow.h"
......
......@@ -21,6 +21,7 @@
*************************************************************************/
#include "breeze.h"
#include "breezemetrics.h"
#include "config-breeze.h"
#include "breezehelper.h"
......
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