mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Another fix for the visual artifact in the editor, removed the rounded corner of the toolstrips and made the overflow button even more "invisible". [skip ci]
This commit is contained in:
parent
d3dce880dd
commit
768efcf7fe
1 changed files with 48 additions and 43 deletions
|
@ -17,46 +17,51 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Greenshot.Controls {
|
||||
/// <summary>
|
||||
/// Prevent having a gradient background in the toolstrip, and the overflow button
|
||||
/// See: http://stackoverflow.com/a/16926979
|
||||
/// </summary>
|
||||
internal class CustomProfessionalColorTable : ProfessionalColorTable {
|
||||
public override Color ToolStripGradientBegin {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
public override Color ToolStripGradientMiddle {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
public override Color ToolStripGradientEnd {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
public override Color OverflowButtonGradientBegin {
|
||||
get { return SystemColors.ControlDark; }
|
||||
}
|
||||
public override Color OverflowButtonGradientMiddle {
|
||||
get { return SystemColors.ControlDark; }
|
||||
}
|
||||
public override Color OverflowButtonGradientEnd {
|
||||
get { return SystemColors.ControlDark; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ToolStripProfessionalRenderer without having a visual artifact
|
||||
/// See: http://stackoverflow.com/a/16926979
|
||||
/// </summary>
|
||||
public class CustomToolStripProfessionalRenderer : ToolStripProfessionalRenderer {
|
||||
public CustomToolStripProfessionalRenderer() : base(new CustomProfessionalColorTable()) {
|
||||
}
|
||||
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) {
|
||||
// Don't draw a border
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Greenshot.Controls {
|
||||
/// <summary>
|
||||
/// Prevent having a gradient background in the toolstrip, and the overflow button
|
||||
/// See: http://stackoverflow.com/a/16926979
|
||||
/// </summary>
|
||||
internal class CustomProfessionalColorTable : ProfessionalColorTable {
|
||||
public override Color ToolStripGradientBegin {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
public override Color ToolStripGradientMiddle {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
public override Color ToolStripGradientEnd {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
public override Color OverflowButtonGradientBegin {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
public override Color OverflowButtonGradientMiddle {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
public override Color OverflowButtonGradientEnd {
|
||||
get { return SystemColors.Control; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ToolStripProfessionalRenderer without having a visual artifact
|
||||
/// See: http://stackoverflow.com/a/16926979 and http://stackoverflow.com/a/13418840
|
||||
/// </summary>
|
||||
public class CustomToolStripProfessionalRenderer : ToolStripProfessionalRenderer {
|
||||
public CustomToolStripProfessionalRenderer() : base(new CustomProfessionalColorTable()) {
|
||||
RoundedEdges = false;
|
||||
}
|
||||
/// <summary>
|
||||
/// By overriding the OnRenderToolStripBorder we can make the ToolStrip without border
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) {
|
||||
// Don't draw a border
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue