• 修复linux lazarus Object Inspector下拉列表文字颜色和背景颜色相同导致不显示的问题


    修复lazarus在linux(ubuntu、银河麒麟等) Object Inspector下拉文字不显示的问题。
    打开lazarus\components\ideintf\objectinspector.pp(3489行开始),按红字的修改后重新编译lazarus就可以。

    procedure TOICustomPropertyGrid.ValueComboBoxDrawItem(Control: TWinControl;
      Index: Integer; ARect: TRect; State: TOwnerDrawState);
    var
      CurRow: TOIPropertyGridRow;
      ItemValue: string;
      AState: TPropEditDrawState;
      FontColor: TColor;
    begin
      if (FItemIndex>=0) and (FItemIndex<FRows.Count) then begin
        CurRow:=Rows[FItemIndex];
        if (Index>=0) and (Index<ValueComboBox.Items.Count) then
          ItemValue:=ValueComboBox.Items[Index]
        else
          ItemValue:='';
        AState:=[];
        if odSelected in State then Include(AState,pedsSelected);
        if odFocused in State then Include(AState,pedsFocused);
        if odComboBoxEdit in State then
          Include(AState,pedsInEdit)
        else
          Include(AState,pedsInComboList);
    
        if not(odBackgroundPainted in State) then
          ValueComboBox.Canvas.FillRect(ARect);
    
        FontColor := ValueComboBox.Canvas.Font.Color;
        ValueComboBox.Canvas.Font.Assign(FDefaultValueFont);
        if odSelected in State then
          ValueComboBox.Canvas.Font.Color := FontColor
        else
          ValueComboBox.Canvas.Font.Color := clHighlightText;//2022.5.24 LBZ 字体颜色与背景颜色相同的Bug
        if CurRow.Editor.HasDefaultValue and (ItemValue = CurRow.Editor.GetDefaultValue) then
          ValueComboBox.Canvas.Font.Style := ValueComboBox.Canvas.Font.Style + [fsItalic];
        CurRow.Editor.ListDrawValue(ItemValue,Index,ValueComboBox.Canvas,ARect,AState);
      end;
    end;

    修复前:


    修复后:

  • 相关阅读:
    LeetCode--Divide Two Integers
    mysql多实例安装与ssl认证
    ajax请求
    mysql5.6升级及mysql无密码登录
    mysql5.7密码设置
    BusyBox 添加 自定义命令小程序 (applet)
    分享9个常用的国外英文论文文献数据库
    arm linux 移植 gdb/gdbserver
    使用 mtd-utils 烧写Arm Linux 系统各个部分
    YUV图解 (YUV444, YUV422, YUV420, YV12, NV12, NV21)
  • 原文地址:https://www.cnblogs.com/qiufeng2014/p/16305303.html
Copyright © 2020-2023  润新知